I'm getting the following output when running virtualenv newvenv.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 700, in subscribe
callback(dist)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2727, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2227, in activate
self.insert_on(path)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2334, in insert_on
self.check_version_conflict()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2373, in check_version_conflict
for modname in self._get_metadata('top_level.txt'):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2221, in _get_metadata
for line in self.get_metadata_lines(name):
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1209, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1201, in get_metadata
return self._get(self._fn(self.egg_info,name))
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1316, in _get
stream = open(path, 'rb')
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/stevedore-1.5.0.egg-info/top_level.txt'
I haven't made virtualenvs in a while, but the last time I did, there was no permissions issue. virtualenv is up-to-date. While I could go messing around with permissions in the specified file in the trace, I'd rather not. Has anyone else run into similar issues with virtualenv, and if so, how did you solve them?
EDIT
The error comes up when trying to make the virtualenv in ~/venvs (Ubuntu 12.04), the same place as before the problem starting occurring, so there's no mounting problem.
Related
I used coda for a long time, with limited problems.
However, I recently installed Miniconda2 (Miniconda2-latest-Linux-x86_64.sh) on a HPC node.
Everything works fine, but I can not install multiple packages.
What happens, is that I install one package, and after that, I get the following error when I try to install a new one:
Traceback (most recent call last):
File "/hpc-home/ro/miniconda2/bin/conda", line 13, in <module>
sys.exit(main())
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/cli/main.py", line 150, in main
return conda_exception_handler(_main, *args, **kwargs)
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1335, in conda_exception_handler
return_value = exception_handler(func, *args, **kwargs)
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1046, in __call__
return self.handle_exception(exc_val, exc_tb)
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1090, in handle_exception
return self.handle_unexpected_exception(exc_val, exc_tb)
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1101, in handle_unexpected_exception
self.print_unexpected_error_report(error_report)
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/exceptions.py", line 1171, in print_unexpected_error_report
from .cli.main_info import get_env_vars_str, get_main_info_str
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/cli/main_info.py", line 19, in <module>
from ..core.index import _supplement_index_with_system
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/core/index.py", line 9, in <module>
from .package_cache_data import PackageCacheData
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda/core/package_cache_data.py", line 15, in <module>
from conda_package_handling.api import InvalidArchiveError
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/conda_package_handling/api.py", line 3, in <module>
from libarchive.exception import ArchiveError as _LibarchiveArchiveError
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/libarchive/__init__.py", line 1, in <module>
from .entry import ArchiveEntry
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/libarchive/entry.py", line 6, in <module>
from . import ffi
File "/hpc-home/ro/miniconda2/lib/python2.7/site-packages/libarchive/ffi.py", line 27, in <module>
libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
File "/hpc-home/ro/miniconda2/lib/python2.7/ctypes/__init__.py", line 444, in LoadLibrary
return self._dlltype(name)
File "/hpc-home/ro/miniconda2/lib/python2.7/ctypes/__init__.py", line 366, in __init__
self._handle = _dlopen(self._name, mode)
OSError: /lib64/liblzma.so.5: version `XZ_5.2' not found (required by /hpc-home/ro/miniconda2/lib/libarchive.so.13)
The problem is temporally fixed when I re-install conda:
bash Miniconda2-latest-Linux-x86_64.sh -u
I am not sure what I am missing here. Would someone point me towards a potential solution not involving using sudo, as I have no rights?
I was installing pycrypto, and was careless and installed the win32 version instead. Unfortunately, when I go to uninstall it, it cannot find the file specified (full error below). Thanks for any help.
Uninstalling pycrypto-2.6:
c:\python27\lib\site-packages\pycrypto-2.6-py2.7-win32.egg
Proceed (y/n)? y
Successfully uninstalled pycrypto-2.6
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:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\pip.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\pip\__init__.py", line 233, in main
return command.main(cmd_args)
File "c:\python27\lib\site-packages\pip\basecommand.py", line 252, in main
pip_version_check(session)
File "c:\python27\lib\site-packages\pip\utils\outdated.py", line 102, in
pip_version_check
installed_version = get_installed_version("pip")
File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 838, in
get_installed_version
working_set = pkg_resources.WorkingSet()
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 644, in __init__
self.add_entry(entry)
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 700, in add_entry
for dist in find_distributions(entry, True):
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1949, in find_eggs_in_zip
if metadata.has_metadata('PKG-INFO'):
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1463, in has_metadata
return self.egg_info and self._has(self._fn(self.egg_info, name))
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1823, in _has
return zip_path in self.zipinfo or zip_path in self._index()
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1703, in zipinfo
return self._zip_manifests.load(self.loader.archive)
File "c:\python27\lib\site-packages\pip\_vendor\pkg_resources\__init__.py",
line 1643, in load
mtime = os.stat(path).st_mtime
WindowsError: [Error 2] The system cannot find the file specified:
'c:\\python27\\lib\\site-packages\\pycrypto-2.6-py2.7-win32.egg'
The key parts of the output are:
Uninstalling pycrypto-2.6:
c:\python27\lib\site-packages\pycrypto-2.6-py2.7-win32.egg
Proceed (y/n)? y
Usually, there's a long list of files here. In your case, it's only an .egg. Which means that you installed the package as a packed .egg (thus most probably, you installed it with easy_install rather than pip: pip always unpacks .eggs).
Now,
WindowsError: [Error 2] The system cannot find the file specified:
'c:\\python27\\lib\\site-packages\\pycrypto-2.6-py2.7-win32.egg'
Means that the .egg was already deleted (probably you deleted it by hand, or a previous uninstallation process was interrupted), but installation metadata wasn't. IIRC it's kept in a file or directory named something like pycrypto-2.6-py2.7-win32.egg-info.
So, locate it in site-packages and delete it.
I a trying to create a django project by using "django-admin startproject sitedemo" but the following error came
shivam#shivam-HP-15-Notebook-PC:~$ django-admin startproject sitedemo
Traceback (most recent call last):
File "/usr/local/bin/django-admin", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in <module>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 933, in subscribe
callback(dist)
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 3032, in <lambda>
add_activation_listener(lambda dist: dist.activate())
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2576, in activate
for pkg in self._get_metadata('namespace_packages.txt'):
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2566, in _get_metadata
for line in self.get_metadata_lines(name):
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1589, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1581, in get_metadata
return self._get(self._fn(self.egg_info, name))
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line http://stackoverflow.com/editing-help1692, in _get
with open(path, 'rb') as stream:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/protobuf-3.0.0b3-py2.7.egg/EGG-INFO/namespace_packages.txt'
please help me how to resolve these errors and create a project in django
Okk ! I think you have not created any virtual enviornment first.
So please first create the enviornment for this project like
virtualenv enviornment_name
cd enviornment_name
source bin/activate
cd ..
django-admin.py startproject sitedemo
My system is RedHat 7.0 + python3.4
There is no package with yum install.
So i use
python3 ez_setup.py
to install Setuptools.
But there are some errors showed up
Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-8.2.1.zip
Extracting in /tmp/tmpzu9sj75k
Traceback (most recent call last):
File "ez_setup.py", line 332, in <module>
sys.exit(main())
File "ez_setup.py", line 329, in main
return _install(archive, _build_install_args(options))
File "ez_setup.py", line 51, in _install
with archive_context(archive_filename):
File "/usr/local/lib/python3.4/contextlib.py", line 59, in __enter__
return next(self.gen)
File "ez_setup.py", line 101, in archive_context
archive.extractall()
File "/usr/local/lib/python3.4/zipfile.py", line 1240, in extractall
self.extract(zipinfo, path, pwd)
File "/usr/local/lib/python3.4/zipfile.py", line 1228, in extract
return self._extract_member(member, path, pwd)
File "/usr/local/lib/python3.4/zipfile.py", line 1290, in _extract_member
with self.open(member, pwd=pwd) as source, \
File "/usr/local/lib/python3.4/zipfile.py", line 1210, in open
close_fileobj=not self._filePassed)
File "/usr/local/lib/python3.4/zipfile.py", line 651, in __init__
self._decompressor = _get_decompressor(self._compress_type)
File "/usr/local/lib/python3.4/zipfile.py", line 614, in _get_decompressor
return zlib.decompressobj(-15)
AttributeError: 'NoneType' object has no attribute 'decompressobj'
why is that so hard to install pip3....
Can anyone help me? Thanks!
I used this to install
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
I found this if it can help you :
http://showmedo.com/videotutorials/video?name=2070000
I'm fairly new to Python, and Nitrous.IO, and MongoDB, and command line in general so would appreciate a little guidance here if possible.
I'm trying to install pymongo on my Nitrous.IO box but can't seem to find a way to do it - this tutorial suggests 'import pymongo' but that didn't work (see below).
I can't seem to find any tutorials or help on this - a google search for "install +pymongo with nitrous.io" gave me 0 results.
action#thirdyearproject-148753:~(master*)$ import pymongo
import: unable to open X server `' # error/import.c/ImportImageCommand/366.
action#thirdyearproject-148753:~(master*)$ pip install pymongo
Traceback (most recent call last):
File "/home/action/.parts/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2431, in load_entry_point
return ep.load()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2147, in load
['__name__'])
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/__init__.py", line 10, in <modul
from pip.util import get_installed_distributions, get_prog
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/util.py", line 15, in <module>
from pip.locations import site_packages, running_under_virtualenv, virtualenv_no_global
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/locations.py", line 96, in <modu
build_prefix = _get_build_prefix()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg/pip/locations.py", line 64, in _get_
path = os.path.join(tempfile.gettempdir(), 'pip_build_%s' %
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/tempfile.py", line 269, in gettempdir
tempdir = _get_default_tempdir()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/tempfile.py", line 212, in _get_default_tempdir
("No usable temporary directory found in %s" % dirlist))
IOError: [Errno 2] No usable temporary directory found in ['/tmp', '/var/tmp', '/usr/tmp', '/home/action']
action#thirdyearproject-148753:~(master*)$ easy_install pymongo
Traceback (most recent call last):
File "/home/action/.parts/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 2829, in <module>
working_set = WorkingSet._build_master()
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 451, in _build_master
return cls._build_from_requirements(__requires__)
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 464, in _build_from_requirements
dists = ws.resolve(reqs, Environment())
File "/home/action/.parts/packages/python2/2.7.6/lib/python2.7/site-packages/pkg_resources.py", line 639, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: setuptools==2.2
action#thirdyearproject-148753:~(master*)$ parts install pymongo
parts: ERROR: Package "pymongo" not found
Aborting!
Does anyone know how I would go about installing this? It's starting to be a real pain!
You might be able to install it withpip using this advice. Once you've done that, you would use the import pymongo at the top of your code file.