how to install scrapy under python3 - python

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.

Related

Webots using Python 2.7 when Python 3.x is default

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

ANTLR3 python runtime not detected

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.

Importing python project from github

Im trying to download this project in python from github
and import it to eclipse ubuntu.
The interpreter of python is 3 and I noticed that after the git clone and running the setup.py, the output is in folder python 2.7 instead of python 3
And when I try to import scapy_http.http I get an exeption (probably the interpreter looking for it inside python 2.7 folder).
When I try to replace the interpreter to python 2.7 I get other exeption on import scapy.all
the import scapy suppose to come before import scapy_http
I installed scapy for python 3: pip3 install scapy-python3
So how can I import the scapy-http project to my eclipse project given the interpreter is python 3?
Thanks.
It should be ok if you did pip3 install scary-python3. It's a bit hard to tell exactly what's going on (please provide error messages, etc.) but I would suggest you try:
sudo python3 setup.py install
If you haven't already. The problem might be that you left off the 3 and thus it was stored in python 2 libraries.

Getting the correct version of Pmw to install

Problem:
I'd like to install Pmw 2.0.0 (project page here) so that I can use it with tkinter in python3. The setup script from the package detects which version of python you're using and installs the version that is appropriate for your system (Ubuntu 15 in my case). I can't find any references to switches to make it install the 2.0.0 instead of 1.3.3(the Python 2.7 version), nor have I been able to get the script to install to the python3 libraries.
What I've done so far:
I've changed the python version detector in the setup script from
if sys.version_info[0]<3:
version='2.0.0' # really '1.3.3'
packages=['Pmw', 'Pmw.Pmw_1_3_3', 'Pmw.Pmw_1_3_3.lib',]
to
if sys.version_info[0]<2:
version='2.0.0' # really '1.3.3'
packages=['Pmw', 'Pmw.Pmw_1_3_3', 'Pmw.Pmw_1_3_3.lib',]
to attempt to force the installer to default to the python3 version, which it does, but it installs them in the python2.7 libraries (/usr/local/lib/python2.7/distpackages).
What I want to do:
I'm looking for a way to force the installer to put the 3.4-compatible package into the python3 libraries. If that means getting it to install both packages in their respective correct directories, that's fine, too. I'm stumped about what to try next.
Answered by RazZiel on AskUbuntu:
Link here.
Instead of using the command sudo python setup.py build and then sudo python setup.py install, I should have been using python3 to execute the setup script. I've managed to outthink myself pretty badly on this one.

How can I update Python on Mac OS and have RubyGems use the new version?

I am having serious issues trying to download the "therubyracer" gem. I think the problem is that I do not have a working libv8 library to create the gem.
I think I do not have a working libv8 because my RubyGems keeps trying to use "Python 2.5.6", which is too old to gem install libv8. I tried countless ways to update the Python that RubyGems uses, however, I cannot figure it out.
Here is what I have done thus far. I went to http://www.python.org/download/releases/3.3.2/ and downloaded "(Mac OS X 64-bit/32-bit Installer (3.3.2) for Mac OS X 10.6 and later 2.)".
Upon completion of the download, I ran:
gem install libv8 --version 3.11.8.17
Yet, I still received the same error. I noticed the output still said:
"Using Python 2.5.4"
Despite downloading a newer Python version, it is not being used. So how do I change the version of Python that the "gem" command uses? I searched and discovered "virtualenv," which appears to be a good Python manager, however I am a bit at a dead end now. Any help or suggestion?
If libv8 uses the python command from the command line, this should apply:
If you do not care what python2 is installed, you can do this in the command line:
type python # this gives you the path of the python command
python is /usr/bin/python
type python2.7
python is /usr/bin/python2.7
Then you can copy one over the other
cp /usr/bin/python2.7 /usr/bin/python
You can safely copy python2.7 there because it is compatible with older versions.
Suggestions?

Categories