If I create a clean virtualenv, upgrade my pip version to 9.0.1 (most recent), and try:
$ pip install asteval
Collecting asteval
Downloading asteval-0.9.10.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-nnWnaR/asteval/setup.py", line 3, in <module>
import asteval
File "asteval/__init__.py", line 20, in <module>
from .asteval import Interpreter
File "asteval/asteval.py", line 18, in <module>
import six
ImportError: No module named six
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-nnWnaR/asteval/
Maybe I'm missing something, I thought pip should handle the dependencies? I thought it used to.
The bypass is to separately pip install six, then asteval will install. But I want to require asteval as an import requirement in my code, and I don't want to have to trace dependencies it might have and list those as requirements.
asteval is making a common mistake: importing itself into its setup.py. You should file a bug against the project, asking them to stop doing that.
Related
I tried to install a module named tushare, I have tried 3 methods: pip, easy_install and setup.py install, they all have the same error:
ImportError: No module named lxml.html
pip:
C:\WINDOWS\system32>pip install tushare
Collecting tushare
Using cached tushare-0.6.8.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\users\endeav~1\appdata\local\temp\pip-build-pkbgde\tushare\setup.py", line 4, in <module>
import tushare
File "tushare\__init__.py", line 6, in <module>
from tushare.stock.trading import (get_hist_data, get_tick_data,
File "tushare\stock\trading.py", line 13, in <module>
import lxml.html
ImportError: No module named lxml.html
easy_install:
C:\WINDOWS\system32>easy_install tushare
Searching for tushare
Reading https://pypi.python.org/simple/tushare/
Downloading https://pypi.python.org/packages/0a/ca/ad9eeed1c285c58d115a0dd82734e5375abf1b6e510c7c24f2f8de921c75/tushare-0.6.8.tar.gz#md5=7626d97088d93d99c1a6ece80302d617
Best match: tushare 0.6.8
Processing tushare-0.6.8.tar.gz
Writing c:\users\endeav~1\appdata\local\temp\easy_install-iisas7\tushare-0.6.8\setup.cfg
Running tushare-0.6.8\setup.py -q bdist_egg --dist-dir c:\users\endeav~1\appdata\local\temp\easy_install-iisas7\tushare-0.6.8\egg-dist-tmp-dakavz
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
.......
File "c:\users\endeav~1\appdata\local\temp\easy_install-iisas7\tushare-0.6.8\tushare\stock\trading.py", line 13, in <module>
ImportError: No module named lxml.html
setup.py install
C:\WINDOWS\system32>cd C:\Users\Endeavour\Desktop\tushare-0.6.8
C:\Users\Endeavour\Desktop\tushare-0.6.8>setup.py install
Traceback (most recent call last):
File "C:\Users\Endeavour\Desktop\tushare-0.6.8\setup.py", line 4, in <module>
import tushare
File "C:\Users\Endeavour\Desktop\tushare-0.6.8\tushare\__init__.py", line 6, in <module>
from tushare.stock.trading import (get_hist_data, get_tick_data,
File "C:\Users\Endeavour\Desktop\tushare-0.6.8\tushare\stock\trading.py", line 13, in <module>
import lxml.html
ModuleNotFoundError: No module named 'lxml'
I have installed python 2.7 and 3.0 on Windows 10, worked on IDLE, no IDE, how can I fix it?
Then I installed lxml:
C:\WINDOWS\system32>pip install lxml
error:
** make sure the development packages of libxml2 and libxslt are installed **
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
I could not use pip to install libxml2 and libxslt.
C:\WINDOWS\system32>pip install libxml2
Collecting libxml2
Could not find a version that satisfies the requirement libxml2 (from versions: )
No matching distribution found for libxml2
C:\WINDOWS\system32>pip install libxslt
Collecting libxslt
Could not find a version that satisfies the requirement libxslt (from versions: )
No matching distribution found for libxslt
What could I do next?
Have you tried installing lxml? It seems that all the tracebacks point to not having a module called lxml. Try typing into your terminal prompt: pip install lxml. lxml installs perfectly for me.
EDIT:
Looks like libxml2 is not available in pip. I found another stackoverflow question. It seems like they are having the same problems you are. The best part is: if you follow the prebuilt binaries link (which I have conveniently linked here for you), there are downloads for lxml with libxml2 and libsxlt bundled in!
I have python 3.5 and 2.7 installed (I don't know if this might be the problem) and I need to use ZeroC Ice and when I do:
sudo pip install ice
I get the following error in the terminal:
Collecting ice
Using cached ice-0.0.1.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-MoRI5C/ice/setup.py", line 32, in <module>
import ice
File "ice.py", line 46, in <module>
import urllib.parse
ImportError: No module named parse
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-MoRI5C/ice/
But parse is already installed (I guess):
sudo -H pip install parse
Requirement already satisfied (use --upgrade to upgrade): parse in /usr/local/lib/python2.7/dist-packages
How can I solve this please?
THanks
This is a simple mistake, try this instead.
pip install zeroc-ice
This should do the correct job.
I'm trying to install fuel and blocks with
pip install git+git://github.com/mila-udem/blocks.git#v0.0.1
pip install git+git://github.com/mila-udem/fuel.git#v0.0.1
(I was using the root account)
Then I encountered the problem
pip install git+git://github.com/mila-udem/fuel.git#v0.0.1
Downloading/unpacking git+git://github.com/mila-udem/fuel.git#v0.0.1
Cloning git://github.com/mila-udem/fuel.git to /tmp/pip-PnqUs3-build
Running setup.py (path:/tmp/pip-PnqUs3-build/setup.py) egg_info for package from git+git://github.com/mila-udem/fuel.git
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/__init__.py", line 11, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/extern/__init__.py", line 1, in <module>
ImportError: No module named extern
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 3, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/__init__.py", line 11, in <module>
File "build/bdist.linux-x86_64/egg/setuptools/extern/__init__.py", line 1, in <module>
ImportError: No module named extern
----------------------------------------
Cleaning up...
I have tried to reinstall/update setuptools and still can't get it work. Thanks.
download: https://pypi.python.org/pypi/extern/0.1.0
install: tar zxf extern-0.1.0.tar.gz && python setup.py install
I had the same issue on CentOS7 and got it resolved by doing:
pip install -U extern
You can cross check in your active python version, if you can import the module extern. If that works, then rebuild your easy_install from the downloaded ez_setup.py. e.g. /opt/bin/python ez_setup.py
This will include the extern module into the easy_install routine and the error doesn't show up anymore.
Running then /opt/bin/easy_install <your.egg> should do the job. Note: if you have more than one python version, use fully qualified names or softlinks you created in /usr/bin/
I am getting errors when trying to install python-daemon 2.0.5 with pip & python 2.6. I know there are other questions that refer to python-daemon 2.0.3 having this problem. But those answers indicate it should be fixed now.
I've tried installing older versions as well without luck. Although if I start over with a fresh virtualenv I am able to install 1.5.6 . However in this virtualenv I get the same error with 2.0.5 and 1.5.6
(py26)[brianb#api proj]$ pip install python-daemon
Downloading/unpacking python-daemon
Downloading python-daemon-2.0.5.tar.gz (71Kb): 71Kb downloaded
Running setup.py egg_info for package python-daemon
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/brianb/py26/build/python-daemon/setup.py", line 26, in <module>
import version
File "version.py", line 438
for item in versions}
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "/home/brianb/py26/build/python-daemon/setup.py", line 26, in <module>
import version
File "version.py", line 438
for item in versions}
^
SyntaxError: invalid syntax
----------------------------------------
Command python setup.py egg_info failed with error code 1
Storing complete log in /home/brianb/.pip/pip.log
This is strange! I tried to upgrade virtualenv too, but this did not work out.
To get it running, I had to upgrade to Python 2.7.
I have python3 installed on linux. In the python interpreter, I tried
import sqlite3
and got
ImportError: No module named '_sqlite3'
so i installed sqlite with
sudo apt-get install libsqlite-dev
and then recompiled python according to the instructions in the README file:
cd ~/Python-3.4.2;
./configure;
make;
make test;
and during test there was an error saying
[ 97/389] test_sqlite
test_sqlite skipped -- No module named '_sqlite3'
and then when I finished the install and tried to run the same python code, I still got the same ImportError. What am I doing wrong?
---EDIT---
I tried
pip install pysqlite
and got this error, which seems to be an issue between Python2.7 and Python3.4:
Downloading/unpacking pysqlite
Downloading pysqlite-2.6.3.tar.gz (76kB): 76kB downloaded
Running setup.py (path:/tmp/pip_build_plat/pysqlite/setup.py) egg_info for package pysqlite
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_plat/pysqlite/setup.py", line 85
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: Missing parentheses in call to 'print'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_plat/pysqlite/setup.py", line 85
print "Is sphinx installed? If not, try 'sudo easy_install sphinx'."
^
SyntaxError: Missing parentheses in call to 'print'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_plat/pysqlite
Storing debug log for failure in /home/plat/.pip/pip.log
After install libsqlite-dev you should install pysqlite
pip install pysqlite