I am trying to run a simulator (developed by someone else) and make it work. I don't know Python but have started learning it. Could someone please look at the error below and advice me if it could be fixed or what it means. It should generate an image file at the end but it doesn't.
The error is:
You probably don't have the six Python module installed in your python version 2.6. You can find it on pypi.
To install it:
$ easy_install six
if 2.6 is not your default version, use instead:
$ easy_install-2.6 six
Related
On my mac I switched python versions to 3.7 and when using the command python -V in the terminal it shows that it successfully switched. Webots still shows that the deprecated 2.7 version is being used. When I checked the command, it says python
I've messed with creating a runtime.ini as well, which seemed to work but doesn't recognize webot modules like "Controller," or "Robot." Though I can't find anything about what the module names would be and how I could include them in the Options for the runtime.ini with the -m flag.
Any help would be appreciated, thanks
I was able to solve this by setting the absolute path, shown in the image link, to a valid version of Python 3 in the Webots->Preferences command field. I had a slight error with NumPy not coming with this version but was easily fixable by doing <absolute-path-to-version-specified> -m pip install NumPy
I hope this is helpful to others as it was the last thing I tried and cost me some time.
Webots preferences screenshot example
I'm getting:
"ImportError: No module named builtins"
that has only started happening after I installed a later version of PsychoPy (an application that uses Python that is used for writing psychology experiments). I was not getting this problem with an older version
I tried doing "sudo pip install future" like someone else recommended for fixing a similar problem. However, when I do this I get an "invalid syntax" error, and don't know of any other way around the problem. I would greatly appreciate any help on this.
Edit
Could it be you enter the command into a Python prompt? You are supposed to enter that command on the command line of your operating system shell. Which means not inside Python.
Original Answer
Like Deesha already mentioned in their comment, you must install the future package into the Python environment you wish to run PsychoPy in, e.g. via pip:
pip install future
or via conda:
conda install future
This is because newer versions of PsychoPy support both Python 2.7 and 3. The future package is used to ensure the code runs on both platforms.
I want to use fstpso package in python which needs ANTLR3 python runtime.
I downloaded antlr_python_runtime-3.1.3.tar.gz from http://www.antlr3.org/download/Python/ and ran the command sudo python setup.py install. The output of the command was
Installed /path/to/python/packages/antlr_python_runtime-3.1.3-py2.7.egg
But after this when I try to import fstpso module in python, it throws the error
The ANTLR3 python runtime was not detected; pyfuzzy cannot import FST-PSO's FLC files
I am using python 2.7.12 on linux.
Is there something I did wrong? Or I have to update any PATH in the environment?
Thanks for your help!!
I'm fst-pso main developer. In the last days I reimplemented the Sugeno reasoner from scratch, to finally remove the pufuzzy/ANTL3 dependency. I just uploaded the new package on PyPI.
Now you can pip install the new version of fst-pso (v 1.4.0); please let me know if that works correctly.
i have installed twisted,lxml,scrapy successively using cmd.When i import scrapy in cmd window,it doesn't raise exception.
but when i import scrapy in spyder,it raise exception like following:
i wonder if there are some solutions?Thanks in advance.
I am assuming you have installed scrappy using pip under windows correct?
The issue at hand has everything to do with python and spyder being able to see the install. I had similar issues with opencv when first installing.
The get around this, I compiled both opencv and python together and installed them.
I vote you try and perform the install using the python console in spyder.
pip install scrampy
Did you install the python 3 upon python 2?
If true, the scrapy may be integrated to python 2.
confirm the version with this instruction in the command line.
python --version
If it says Python 2.7.x, you tested on the python 2 when trying with cmd.
Let me know you have both of version on your computer.
When I try and use easy_install PIL it will give me the error:
File "setup.py", line 182
print "--- using Tcl/Tk libraries at", TCL_ROOT
^
SyntaxError: invalid syntax
It is extremely annoying and I have tried installing it from a package as well. I've downloaded Imaging-1.1.7 and it gives the same error. I am trying to get the Image module in Python 3.4.1. I've tried installing Pillow 2.4 but it doesn't show up in the module list when I type pydoc3.4 modules and none of the applications even detect it's existence. Please help because I am getting desperate. I am on Mac OS X 10.8.4 with Python 3.4.1.
That syntax for print only exists in Python 2.x, where print is a statement. However, it was removed entirely in Python 3.x when print became a function.
This means that your version of PIL is incompatible with Python 3.x. So, you now have two options:
Get a version of PIL that is compatible with Python 3.x. This question has more information on that.
Downgrade to Python 2.x.
I have also tried brew install PIL and pip install PIL and I encountered the same issue, because I'm using python 3.4. But I just solved the problem today. This is thanks to Ned Deily's answer above, which i need to figure out first how to do since i'm not well experienced with pip stuffs.
So to do it, you need to head over to https://pypi.python.org/pypi/Pillow/ and click the latest version. (found version 2.6.1 at the time of this writing). You should see something like Pillow-(version).tar.gz (found Pillow-2.6.1.tar.gz). Just right click it and copy link address if you're using chrome browser and type in the following in your terminal.
pip install https://pypi.python.org/packages/source/P/Pillow/Pillow-2.6.1.tar.gz#md5=4b77fb0c81bbe0c8bf90c6eea960e091
that should do the trick