How to reproduce:
Get an up-to-date Arch Linux installation (or Travis CI instance)
Run this:
git clone https://github.com/l0b0/make-includes.git
cd make-includes
git checkout 643b15af0cf246ab669176b2c564bf9f88b63c0b # current HEAD
make test
Result:
/tmp/tmp.Hwv8afXNsE/virtualenv/virtualenv-12.1.1/virtualenv.py --python=/tmp/tmp.Hwv8afXNsE/Python-2.7.10-install/bin/python2.7 /tmp/tmp.Hwv8afXNsE/virtualenv-2.7.10
Traceback (most recent call last):
File "/tmp/tmp.Hwv8afXNsE/virtualenv/virtualenv-12.1.1/virtualenv.py", line 2352, in <module>
main()
File "/tmp/tmp.Hwv8afXNsE/virtualenv/virtualenv-12.1.1/virtualenv.py", line 763, in main
options, args = parser.parse_args()
File "/usr/lib/python3.5/optparse.py", line 1370, in parse_args
values = self.get_default_values()
File "/tmp/tmp.Hwv8afXNsE/virtualenv/virtualenv-12.1.1/virtualenv.py", line 642, in get_default_values
return optparse.Values(defaults)
File "/usr/lib/python3.5/optparse.py", line 827, in __init__
setattr(self, attr, val)
TypeError: attribute name must be string, not 'NoneType'
python.mk:85: recipe for target '/tmp/tmp.Hwv8afXNsE/virtualenv-2.7.10' failed
make[1]: *** [/tmp/tmp.Hwv8afXNsE/virtualenv-2.7.10] Error 1
make[1]: Leaving directory '/home/user/dev/make-includes'
Makefile:32: recipe for target 'test-python-virtualenv' failed
make: *** [test-python-virtualenv] Error 2
Interestingly, if I run that last command again just afterwards, it works:
$ /tmp/tmp.Hwv8afXNsE/virtualenv/virtualenv-12.1.1/virtualenv.py --python=/tmp/tmp.Hwv8afXNsE/Python-2.7.10-install/bin/python2.7 /tmp/tmp.Hwv8afXNsE/virtualenv-2.7.10
Running virtualenv with interpreter /tmp/tmp.Hwv8afXNsE/Python-2.7.10-install/bin/python2.7
New python executable in /tmp/tmp.Hwv8afXNsE/virtualenv-2.7.10/bin/python2.7
Also creating executable in /tmp/tmp.Hwv8afXNsE/virtualenv-2.7.10/bin/python
Installing setuptools, pip...done.
What gives?
Related
Trying to install package with following command and got an error
pip install pyleniumio
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\base_command.py", line 188, in _main
status = self.run(options, args)
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\cli\req_command.py", line 185, in wrapper
return func(self, options, args)
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\commands\install.py", line 407, in run
use_user_site=options.use_user_site,
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\req\__init__.py", line 71, in install_given_reqs
**kwargs
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\req\req_install.py", line 811, in install
direct_url=direct_url,
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\install\wheel.py", line 630, in install_wheel
direct_url=direct_url,
File "c:\users\mi\appdata\local\programs\python\python37\lib\site-packages\pip\_internal\operations\install\wheel.py", line 452, in install_unpacked_whee
l
dest = getattr(scheme, subdir)
AttributeError: 'Scheme' object has no attribute 'conftest.py'
Some python packages require other ways, for example, the POT package requires a specific C++ compiler to install. Make sure you read the entire instructions and have everything you need. Another thing that works for me if you have all the requirements and you are running Linux like me, you can just simply lead your terminal to where the file is and just run for example python package.py and it installs. Hopefully, this helped you and you can install your package.
After I run "pip3 install rsa==3.4.2". I cannot use "pip3 list" command any more and pretty much any pip command will fail.
The error is like the following
Exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2584, in version
return self._version
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2691, in __getattr__
raise AttributeError(attr)
AttributeError: _version
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_internal/cli/base_command.py", line 176, in main
status = self.run(options, args)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_internal/commands/list.py", line 148, in run
self.output_package_listing(packages, options)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_internal/commands/list.py", line 205, in output_package_listing
data, header = format_for_columns(packages, options)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_internal/commands/list.py", line 271, in format_for_columns
row = [proj.project_name, proj.version]
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py", line 2589, in version
raise ValueError(tmpl % self.PKG_INFO, self)
ValueError: ("Missing 'Version:' header and/or METADATA file", Unknown [unknown version] (/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages))
I don't have any clue so far. I wonder if there is an solution to this?
Thanks
I had same issue and solved by following,
python3 -c "import site; print(site.getsitepackages())"
will list the location of site-packages,
['/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages', '/Library/Python/3.6/site-packages']
and check the invalid directories,
cd /usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
find . -name METADATA
for me ./-ip-18.1.dist-info/pip-18.1.dist-info/METADATA was the problem and I deleted the directory.
rm -rf ./-ip-18.1.dist-info
everything seems to be fine now.
My python version is 2.7. I tried to install pyjags using pip install pyjags but got such error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 68, in <module>
add_jags(ext)
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 46, in add_jags
version = add_pkg_config(ext, 'jags')
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 34, in add_pkg_config
output = subprocess.check_output(args)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags
I just deployed a python package and had same errors when I tried to install via pip. Turns out the main reasons was that the project artifacts (static files, etc) were not included in the MANIFEST file or it couldn't load a file path. I think you might want to consult the documentation here.
The line below was copied from the docs:
The setup.py script uses pkg-config to locate the JAGS library. If JAGS is installed in some non-standard location, then you may need to configure pkg-config to pick up correct metadata file. For example, if JAGS have been configured with --prefix=/opt/, then JAGS metadata file would be located in /opt/lib/pkgconfig/. This path can be included in pkg-config search path as follows:
export PKG_CONFIG_PATH=/opt/lib/pkgconfig/:$PKG_CONFIG_PATH
From your track trace, it seems like you failed to configure that.
pip is not a supported installation method. Read the installation instructions on the website enter link description here.
For testing a Python library, I can do either
python setup.py install
python setup.py test
or
python setup.py build
python setup.py test
I prefer doing it the latter way. What things would I be missing to not go for the first?
EDIT : How can I test the installed code? The latter way is not doing that.
NOTE : I'm not choosing first because in that case I think something at permission level goes wrong over Travis-CI.
This is the error log
======================================================================
ERROR: Failure: OSError ([Errno 20] Not a directory: '/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/networkx_metis-1.0-py2.7-linux-x86_64.egg/networkx')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/nose/loader.py", line 414, in loadTestsFromName
addr.filename, addr.module)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/nose/importer.py", line 86, in importFromDir
if (self.sameModule(old, filename)
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/nose/importer.py", line 131, in sameModule
if _samefile(mod_path, new_path):
File "/home/travis/virtualenv/python2.7.9/lib/python2.7/posixpath.py", line 162, in samefile
s1 = os.stat(f1)
OSError: [Errno 20] Not a directory: '/home/travis/virtualenv/python2.7.9/lib/python2.7/site-packages/networkx_metis-1.0-py2.7-linux-x86_64.egg/networkx'
----------------------------------------------------------------------
Ran 1 test in 0.314s
FAILED (errors=1)
The command "python setup.py test" exited with 1
Can't be commented for Travis-CI, but there is actually no difference in the methods suggested.
python setup.py install is accompanied by python setup.py build internally. Just so as, a .egg file is created by install and it is copied to the system's dist-packages or site-packages.
Regarding testing, there is no such difference between the two methods.
I'm trying to install GDAL-1.9.0 under Ubuntu 10.04 via buildout and unfortunately get a very strange error.
python setup.py build
'import site' failed; use -v for traceback
Traceback (most recent call last):
File "setup.py", line 75, in <module>
from distutils.command.build_ext import build_ext
File "/usr/lib/python2.6/distutils/command/build_ext.py", line 13, in <module>
from site import USER_BASE, USER_SITE
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 601, in <module>
main()
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 583, in main
known_paths = addusersitepackages(known_paths)
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 271, in addusersitepackages
user_site = getusersitepackages()
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 246, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/home/student/geoserv_new/geoportal2/trunk/parts/buildout/site.py", line 235, in getuserbase
from sysconfig import get_config_var
ImportError: No module named sysconfig
make[2]: *** [build] Error 1
make[2]: Leaving directory `/tmp/tmpY7oYvSbuildout-gdal/gdal-1.9.0/swig/python'
make[1]: *** [build] Error 2
make[1]: Leaving directory `/tmp/tmpY7oYvSbuildout-gdal/gdal-1.9.0/swig'
make: *** [swig-modules] Error 2
gdal: cmmi failed: /tmp/tmpY7oYvSbuildout-gdal
While:
Installing gdal.
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 1805, in main
getattr(buildout, command)(args)
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 584, in install
installed_files = self[part]._call(recipe.install)
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.buildout-1.5.2-py2.7.egg/zc/buildout/buildout.py", line 1297, in _call
return f()
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 113, in install
self.build()
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 196, in build
self.cmmi(dest)
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 222, in cmmi
system("make")
File "/home/student/geoserv_new/geoportal2/trunk/eggs/zc.recipe.cmmi-1.3.5-py2.7.egg/zc/recipe/cmmi/__init__.py", line 34, in system
raise SystemError("Failed", c)
SystemError: ('Failed', 'make')
Here is my buildout.cfg part of gdal:
[gdal]
recipe = zc.recipe.cmmi
url = http://download.osgeo.org/gdal/gdal-1.9.0.tar.gz
extra_options =
--with-python
--with-geos=${geos:location}/bin/geos-config
Even more strange that when I'm going to python2.7 shell and try import sysconfig. Everything is working fine. Any suggestion about this?
Thanks,
Sergey
You mention that you tested it in the 'python2.7' shell.
This:
File "/usr/lib/python2.6/distutils/command/build_ext.py",
Implies that buildout is running in python 2.6.
Is sysconfig available in your python2.6 environment, or are you running buildout under the wrong version?