i was using python today and needed to update pip. I ran the standard python -m pip --upgrade install pip command as system admin but now pip can't do anything and gives a quite bizarre error message:
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 253, in run
options.use_user_site = decide_user_install(
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 604, in decide_user_install
if site_packages_writable(root=root_path, isolated=isolated_mode):
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 548, in site_packages_writable
return all(
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\commands\install.py", line 549, in <genexpr>
test_writable_dir(d) for d in set(get_lib_location_guesses(**kwargs))
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\utils\filesystem.py", line 140, in test_writable_dir
return _test_writable_dir_win(path)
File "C:\Users\adams\AppData\Roaming\Python\Python38\site-packages\pip\_internal\utils\filesystem.py", line 153, in _test_writable_dir_win
fd = os.open(file, os.O_RDWR | os.O_CREAT | os.O_EXCL)
PermissionError: [Errno 13] Permission denied: 'c:\\program files (x86)\\python38-32\\Lib\\site-packages\\accesstest_deleteme_fishfingers_custard_al9l45'
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'c:\program files (x86)\python38-32\python.exe -m pip install --upgrade pip' command.
this is the output if I run any pip updating or even just calling pip install on any package. the referenced file mentioned at the end does not seem to exist on my PC. does anyone know what it is?
PS I have tried running command prompt and PowerShell as both admin and normal user and each time get this exact error
Related
I am currently trying to do a simple git commit -m "first commit" but it is not working
whenever i run this command:
git commit -m "first commit"
I get this error:
env: python3.7: Not a directory
My first attempt was to do brew upgrade python
This pointed python3 to python#3.8.
I ran the git command again but I am still have the same issue.
if i have upgraded to python3.8 why is my terminal still giving me the error:
env: python3.7: Not a directory
My second attempt was to check the environment variable by running the env command
but i do not see any environment variable set to python3.7
After reading python location on mac osx
My third attempt was to create a symbol link to python3.7.
so i did
ln -s /usr/local/Cellar/python/3.7.7/bin/python3.7 /usr/local/bin/python3.7
ln -s /usr/local/Cellar/python/3.7.7/bin/python3.7-config /usr/local/bin/python3.7-config
After this i tested by running a git commit command. The result was
Traceback (most recent call last):
File ".git/hooks/pre-commit", line 44, in <module>
os.execvp(CMD[0], CMD)
File "/usr/local/Cellar/python/3.7.7/bin/../Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 574, in execvp
_execvpe(file, args)
File "/usr/local/Cellar/python/3.7.7/bin/../Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 616, in _execvpe
raise last_exc
File "/usr/local/Cellar/python/3.7.7/bin/../Frameworks/Python.framework/Versions/3.7/lib/python3.7/os.py", line 607, in _execvpe
exec_func(fullname, *argrest)
NotADirectoryError: [Errno 20] Not a directory
Please can you help me to resolve this problem.
Thank you
Traceback (most recent call last):
File ".git/hooks/pre-commit", line 44, in <module>
You've installed a bad pre-commit hook.
I have just installed Python 3.4.3 on my MAC (Yosemite). I need to install a couple of lxml, however everytime I type in: pip install /""/, I get error messages.
I have followed multiple tutorials and pip is installed.
MAC already had Python 2.7., but I installed the 3.4.3. version, not sure if that is the issue.
The error message is:
Brunos-MacBook-Pro:~ BrunoPaesLeme$ pip install /Macintosh HD/Users//Downloads/pycairo-1.10.0-cp27-none-win_amd64.whl
Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg/pip/basecommand.py", line 223, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg/pip/commands/install.py", line 268, in run
wheel_cache
File "/Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg/pip/basecommand.py", line 268, in populate_requirement_set
wheel_cache=wheel_cache
File "/Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg/pip/req/req_install.py", line 207, in from_line
wheel_cache=wheel_cache)
File "/Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg/pip/req/req_install.py", line 66, in init
req = pkg_resources.Requirement.parse(req)
File "/Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg/pip/_vendor/pkg_resources/init.py", line 2960, in parse
reqs = list(parse_requirements(s))
File "/Library/Python/2.7/site-packages/pip-7.0.3-py2.7.egg/pip/_vendor/pkg_resources/init.py", line 2891, in parse_requirements
raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '/Macintosh')
Anybody knows what I could be doing wrong? Any help would be appreciated.
try:
easy_install pip
pip install /"filepath"/
I have similar issue with pip install. However, if I do "sudo su -" then do my pip install 'fileName', that solve the problem for me.
Installing CKAN locally on OSX 10.9, based on http://docs.ckan.org/en/latest/maintaining/installing/install-from-source.html.
I've created and activated the python virtualenv and now need to create a CKAN config file:
$ paster make-config ckan /etc/ckan/default/development.ini
The output is as follows (ImportError at the last line):
Distribution already installed:
ckan 2.2 from ~/ckan/lib/default/src/ckan
Traceback (most recent call last):
File "/usr/lib/ckan/default/bin/paster", line 9, in <module>
load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/command.py", line 104, in run
invoke(command, command_name, options, args[1:])
File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/command.py", line 143, in invoke
exit_code = runner.run(args)
File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/appinstall.py", line 68, in run
return super(AbstractInstallCommand, self).run(new_args)
File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/command.py", line 238, in run
result = self.command()
File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/appinstall.py", line 295, in command
self.distro, self.options.ep_group, self.options.ep_name)
File "/usr/lib/ckan/default/lib/python2.7/site-packages/paste/script/appinstall.py", line 234, in get_installer
'paste.app_install', ep_name)
File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources.py", line 2302, in load_entry_point
return ep.load()
File "/usr/lib/ckan/default/lib/python2.7/site-packages/pkg_resources.py", line 2029, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "~/ckan/lib/default/src/ckan/ckan/config/install.py", line 3, in <module>
from pylons.util import PylonsInstaller
ImportError: No module named pylons.util
I'm not sure how to proceed, any ideas?
ImportError: No module named pylons.util looks like Python cannot find the Pylons package, one of the Python packages that CKAN depends on. Two possibilities come to mind:
Did you activate your CKAN virtualenv, before running the paster command? ~/ckan/default/bin/activate.
Have you installed the Python packages that CKAN depends on into your virtualenv? With the virtualenv activated run pip install -r ~/ckan/default/src/ckan/requirements.txt
If you activate your CKAN virtual environment and then run pip freeze | grep pylons, this should tell you whether pylons is installed in the virtualenv.
The Distribution already installed: at the top of your terminal output is strange.
I had the same error and a slightly different solution:
got the error only after using sudo, so I went out of it (sudo -k)
then I got the following error: IOError: [Errno 13] Permission denied: '/etc/ckan/default/development.ini'
after digging around a lot, I finally found out that while the /etc/ckan had correct permissions, it was actually a symlink to ~/ckan/etc and that folder did not have correct permissions
I ran sudo chown -R `whoami` ~/ckan/etc and followed up with paster make-config ckan /etc/ckan/default/development.ini
I am attempting to install the openstack nova client on my Mac (10.4.8)
nova = https://github.com/openstack/python-novaclient#command-line-api
python --version
Python 2.7.2
I successfully got nova installed (after installing pip)
When I run the client, I get the following error
foo#bar-macbook-pro:~$ nova
Traceback (most recent call last):
File "/usr/local/bin/nova", line 6, in <module>
from novaclient.shell import main
File "/Library/Python/2.7/site-packages/novaclient/__init__.py", line 15, in <module>
import pbr.version
ImportError: No module named pbr.version
In my research, I have found conflicting information about pbr, some say it is required for nova, while others say it isn't required for nova.
https://github.com/rackspace/pyrax/issues/121
When I attempt to install pbr, I see the following error.
foo#bar-macbook-pro:~$ sudo python ~/Downloads/pbr/setup.py install
Traceback (most recent call last):
File "setup.py", line 22, in <module>
**util.cfg_to_args())
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/util.py", line 241, in cfg_to_args
pbr.hooks.setup_hook(config)
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/__init__.py", line 27, in setup_hook
metadata_config.run()
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/base.py", line 29, in run
self.hook()
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/hooks/metadata.py", line 28, in hook
self.config['name'], self.config.get('version', None))
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 817, in get_version
version = _get_version_from_git(pre_version)
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 776, in _get_version_from_git
"git --git-dir=\"" + git_dir + "\" describe --always").replace(
File "/Volumes/WDBlack750/spencerowen/Downloads/pbr/pbr/packaging.py", line 220, in _run_shell_command
stderr=err_location)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 679, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1228, in _execute_child
raise child_exception
TypeError: must be encoded string without NULL bytes, not str
Is there anything apparent that would explain why I can not get the library installed?
Surely I must not be the first person to try and install nova on OS X.
Over a year later, I finally got this working on OS X Yosemite
sudo pip install python-novaclient
I did not have to install pbr.
I did the install based on venv:
virtualenv venv_name
source venv_name/bin/activate
pip install python-novaclient fabric
In my case, I had a mixup in which python I was using by way of fabric being installed globally.
Prior: rf -rf all my virtualenvs, rf -rf all references to novaclient (locally, and globally), and deleted a global install of fabric which was calling the novaclient.
Also as a precaution, I do not install pip globally, and only use it without sudo in virtualenvs.
The pip and easy install commands (install MySQL-python) provide the massive error listed below.
I've been looking around for an answer a while now on this site and through google. The recurring answer is to install python dev (pip install python-dev) however the response I receive is "no distributions at all found"
Does anyone know the correct syntax in order to do this? or could someone be kind enough to point out where I'm going wrong.
All help is greatly appreciated. Thanks
C:\virtualenvs\myvirtualenv2\Scripts\pip-script.py run on 04/13/11 16:28:18
Downloading/unpacking mySQL-python
Running setup.py egg_info for package mySQL-python
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\virtualenvs\myvirtualenv2\build\mySQL-python\setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in <module>
File "C:\virtualenvs\myvirtualenv2\build\mySQL-python\setup.py", line 15, in <module>
metadata, options = get_config()
File "setup_windows.py", line 7, in get_config
serverKey = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, options['registry_key'])
WindowsError: [Error 2] The system cannot find the file specified
----------------------------------------
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\basecommand.py", line 126, in main
self.run(options, args)
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\commands\install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\req.py", line 980, in prepare_files
req_to_install.run_egg_info()
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\req.py", line 216, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\virtualenvs\myvirtualenv2\lib\site-packages\pip-1.0-py2.6.egg\pip\__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
Try ActivePython:
pypm -E C:\virtualenvs\myvirtualenv2 install mysql-python
no compile orgy. no strange errors. no terror.
Installing mysqldb on windows is tricky. I can install it manually, after downloading and unpacking mySQL-python:
Go to MySQL-python-1.2.3 folder
Edit the file site.cfg
Run regedit in Start > Run and verify the proper path for MySQL, mine looks like SOFTWARE\MySQL AB\MySQL Server 5.1
Uncomment the line registry_key
Set it:
registry_key = SOFTWARE\MySQL AB\MySQL Server 5.1
Run python setup.py install under your virtualenv