All of a sudden When I try to add python3 to virtualenv like this
virtualenv -p python3 env
I get the following error
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 726, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 746, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/virtualenv-13.1.2.dist-info/DESCRIPTION.rst'
This just started happening out of nowhere a few hours ago because I have been using it tonite. Can anyone tell me what's going on with this? thanks
Related
When I try pip freeze (or pip freeze > requirements.txt), I've this error :
$ pip freeze
Error [Errno 20] Not a directory: '/usr/local/lib/python2.7/dist-packages/flaskr-0.0.0-py2.7.egg' while executing command git rev-parse
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/commands/freeze.py", line 86, in run
for line in freeze(**freeze_kwargs):
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/operations/freeze.py", line 50, in freeze
dependency_links
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/__init__.py", line 255, in from_dist
if dist_is_editable(dist) and vcs.get_backend_name(location):
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/vcs/__init__.py", line 76, in get_backend_name
if vc_type.controls_location(location):
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/vcs/git.py", line 292, in controls_location
on_returncode='ignore')
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/vcs/__init__.py", line 325, in run_command
spinner)
File "/usr/local/lib/python2.7/dist-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 667, in call_subprocess
cwd=cwd, env=env)
File "/usr/lib/python2.7/subprocess.py", line 711, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1343, in _execute_child
raise child_exception
OSError: [Errno 20] Not a directory: '/usr/local/lib/python2.7/dist-packages/flaskr-0.0.0-py2.7.egg'
I've not error(s) when I install some package. I don't use virtualenv for the moment.
Have an idea about this error please ?
Thanks.
F.
It was just a problem with Flaskr (I don't know why it was here...)
So, I just do :
sudo pip uninstall Flaskr
And, it's done.
I am creating a virtual environment using mkvirtualenv, and I get this error, where have I gone wrong?
$ mkvirtualenv data
New python executable in /home/usman/.virtualenvs/data/bin/python
Installing setuptools, pip, wheel...
Complete output from command /home/usman/.virtualenvs/data/bin/python - setuptools pip wheel:
Collecting setuptools
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/commands/install.py", line 324, in run
requirement_set.prepare_files(finder)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 386, in find_all_candidates
self.find_links, expand_dir=True)
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 236, in _sort_locations
sort_path(os.path.join(path, item))
File "/usr/local/lib/python2.7/dist-packages/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl/pip/index.py", line 217, in sort_path
if mimetypes.guess_type(url, strict=False)[0] == 'text/html':
File "/usr/lib/python2.7/mimetypes.py", line 293, in guess_type
init()
File "/usr/lib/python2.7/mimetypes.py", line 358, in init
db.read(file)
File "/usr/lib/python2.7/mimetypes.py", line 202, in read
with open(filename) as fp:
IOError: [Errno 13] Permission denied: '/usr/local/lib/netscape/mime.types'
sudo chmod a+r /usr/local/lib/netscape/mime.types
This is probably because your file "mime.types" has not the sufficient permission status.
Use the chmod command as mentioned earlier.
I'm trying to install Airflow in Ubuntu 16.04. I get an error when I try:
pip install airflow
Here is the error:
Exception:
Traceback (most recent call last):
File "/home/ashim/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/home/ashim/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/home/ashim/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/dateutil'
And I'd like to mention that you should install other package such as sasl client if you want to use more subpackages(hive, hdfs, etc)
conda install -c blaze sasl=0.2.1
conda install -c conda-forge pure-sasl=0.3.0
sudo pip install airflow
or
sudo pip install "airflow[celery,postgres]"
The second command lists the extra packages needed along with airflow.
Give permission to the "/usr/local/lib/python2.7/dist-packages/dateutil" or to the enitre /usr/local/lib
I was trying to install Django1.10 on my ubuntu 16.04 using pip install Django==1.10. Now I'm facing an error which I think is related to directories of installation path but I don't know how to get through. Here is the error:
Exception:
Traceback (most recent call last):
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 742, in install
**kwargs
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/home/atenagm/.local/lib/python2.7/site-packages/pip/utils/init.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/Django-1.10.dist-info'
Can anybody tell me what I should do to fix it? Thanks in advance.
You may need super user privilege to install a package globally. So append sudo before your command.
sudo pip install Django==1.10
Running pip as sudo is not the best of choices. That is like giving superuser access to an external application. Rather try this first:
pip install --user django==1.11
Doing a "pip install dj-database-url" gave the following errors:
Downloading/unpacking dj-database-url Exception: Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args) File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 942, in prepare_files
location = req_to_install.build_location(self.build_dir, not self.is_download) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 144, in build_location
_make_build_dir(build_dir) File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1185, in
_make_build_dir
os.makedirs(build_dir) File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode) OSError: [Errno 13] Permission denied: '/vagrant/django_projects/microblog/build'
Storing complete log in /var/lib/postgresql/.pip/pip.log
I don't know what i'm doing wrong. Please help.
Setup virtualenv and start it up.
pip install Django psycopg2 south dj-database-url
Use virtualenv or run your command using sudo.