Git Product home page Git Product logo

Comments (10)

laurathepluralized avatar laurathepluralized commented on August 11, 2024

Hi @savasturk,
I think I have run into this issue before; at least in my case, it was an environment setup issue.
First, make sure you have installed the SCRIMMAGE python bindings: https://github.com/gtri/scrimmage/#install-scrimmage-python-bindings
Then, assuming the root directory of the scrimmage repo on your machine is ~/scrimmage/scrimmage, run the following in your terminal to add the relevant SCRIMMAGE directories to your PYTHONPATH:

    export PYTHONPATH=${HOME}/scrimmage/scrimmage/scripts:${HOME}/scrimmage/scrimmage/python:${PYTHONPATH}

Then try to run scrimmage_runner.sh or whatever script that calls generate_scenarios.py in that same terminal. If that works, you may want to add that export line to your ~/.bashrc file, or put it in the script that calls generate_scenarios.py before generate_scenarios.py is called.

@esquires and @SyllogismRXS, if there is a cleaner way to make sure Python finds these directories, feel free to chime in. This seems to work for my environment, at least. I hope it helps, @savasturk!

from scrimmage.

savasturk avatar savasturk commented on August 11, 2024

Thanks, I applied all of them but I am receiving error like this:

Traceback (most recent call last):
File "generate_scenarios.py", line 47, in
import scrimmage.utils as utils
File "/home/pinar/scrimmage/scrimmage/python/scrimmage/init.py", line 33, in
from scrimmage.utils import *
File "/home/pinar/scrimmage/scrimmage/python/scrimmage/utils.py", line 44, in
import google.protobuf.internal.decoder
ModuleNotFoundError: No module named 'google'
Failed to generate scenarios

then run "sudo pip install conda" and "pip install google " but couldn't solve this error.

from scrimmage.

esquires avatar esquires commented on August 11, 2024

can you post the output of

pip --version
python --version

My guess is that the pip function is installing for python3 but generate_scenarios is running python2

from scrimmage.

savasturk avatar savasturk commented on August 11, 2024

Output like:
pip 10.0.1
Python 3.6.3
you are right,how can I solve this probem?
Thanks a lot .

from scrimmage.

esquires avatar esquires commented on August 11, 2024

My guess is that you just need to specify pip3. To make really sure everything is the right version though, try removing your build directory and executing the following

rm CMakeCache.txt
cmake .. -DPYTHON_MIN_VERSION=3.0
make

sudo pip3 install protobuf==3.3.0 grpcio==1.2.1 #note the 3
cd /path/to/scrimmage/python
sudo pip3 install -e .  # note the 3

from scrimmage.

savasturk avatar savasturk commented on August 11, 2024

I tried them but when run ":~/scrimmage/scrimmage/scripts$ ./scrimmage_runner.sh -t 100 -m ../missions/straight-vs-motorschemas.xml -p 7 " in this directory, Ireceived same error. These solutions couldn't solve my error.

from scrimmage.

esquires avatar esquires commented on August 11, 2024

Perhaps if we simplify the setup we can identify the issue. Let's ignore generate_scenarios.py and scrimmage-runner.sh for a moment. Does this work?

$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import google.protobuf.internal.decoder

from scrimmage.

savasturk avatar savasturk commented on August 11, 2024

Yes @esquires it was work.
Output like this:

~/scrimmage/scrimmage/scripts$ python3
Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 13 2017, 12:02:49)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import google.protobuf.internal.decoder

from scrimmage.

esquires avatar esquires commented on August 11, 2024

Can you post the following?

which python

In build/CMakeCache.txt, the line

PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python2.7

from scrimmage.

esquires avatar esquires commented on August 11, 2024

I am going to go ahead and close this. If this is still an issue feel free to re-open and we'll help to resolve your issue.

from scrimmage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.