I just installed Python3.7 and Pycharm on my Windows 10 PC.
I am running pip version 9.0.2
In Pycharm, it says I have version 28.8.0 of setuptools, when I try to upgrade this in Pycharm, which I believe runs the line
pip install -U setuptools
I get the error:
PermissionError: [WinError 32] The process cannot access the file because it
is being used by another process:
'c:\users\Username\pycharmprojects\untitled1\venv\lib\site-
packages\setuptools-28.8.0-py3.6.egg' ->
'C:\Users\Username\AppData\Local\Temp\pip-i5jxitem-
uninstall\users\Username\pycharmprojects\untitled1\venv\lib\site-
packages\setuptools-28.8.0-py3.6.egg'
I have tried running
pip install --upgrade setuptools
which runs successfully and says I have the latest version.
Does anyone know how I can successfully update setuptools?
The reason I'd like setuptools to be up to date, is so I can then get rid of the egg_info error installing other packages.
I have the same error. Not sure why it happened. But I managed to upgrade by running:
pip install setuptools --upgrade --ignore-installed
You can also try:
easy_install --upgrade setuptools
Even though easy_install's deprecated, there's a good chance it'll still work on Windows.
If you try to use pip to upgrade setuptools:
pip install -U setuptools
it seems to get stuck on an error about 10.0 vs 18.0 "You should consider upgrading via the 'python -m pip install --upgrade pip' command."
The official pip doco(https://pip.pypa.io/en/stable/installing/#upgrading-pip) says on Windows to use this:
python -m pip install --upgrade pip
However, it seemed pip and setuptools had a hiccup with a circular dependency or lock around pip-v9.0 or 10.0 to pip-18.0 and setuptools v28.0 to v39.0 or 40.0 so persevere with this:
python -m pip install --force-reinstall pip
You need setuptools >= 39.0 if you want to install pipenv also.
Try the following command to upgrade the setup tools in windows
pip install -U pip setuptools
or
pip install setuptools --upgrade --ignore-installed
I solved more or less similar problem as follow:
In my PyCharm project terminal tab:
`(venv) PS C:/path/to/project>`
updated pip, setup tools and wheels with command:
py -m pip install --upgrade pip setuptools wheel
(source of recommendation)
Related
I was trying to install a package which required an older version of pip and (stupidly) thought it would be a good idea to try installing the oldest version of pip possible (1.0).
To clarify, it is not pip 1.0.1 (which most guides I found on the internet refer to), but pip 1.0
When I attempt to run 'python -m pip install --upgrade pip', I get the following error:
C:\mydirectory\venv\Scripts\python.exe: No module named pip.__main__; 'pip' is a package and cannot be directly executed
When I run 'pip --version', I get the following info:
pip 1.0 from c:\mydirectory\venv\lib\site-packages (python 3.7)
Is there any way I can upgrade pip from this point?
python -m pip install -U pip should work. That is how I do it.
Try this:
python3 -m pip install pip
I get an error when pip builds wheels for the cryptography package.
Error:
LINK : fatal error LNK1181: cannot open input file 'libssl.lib'
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\link.exe' failed with exit status 1181
----------------------------------------
ERROR: Failed building wheel for cryptography
Running setup.py clean for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
I have already installed OpenSSL and set the environment variables as suggested in this post yet the problem persists. My setup details:
System - Windows 10
Python - 3.8
Pip - 19.3.1
In my case (windows 10 + conda) updating pip fixed the problem:
python -m pip install --upgrade pip
Setting cryptography to version 2.8 in requirements.txt fixed the issue.
TLDR;
Try using cryptography==3.1.1
Details:
This happened on Python 3.9.0 on Windows 10 PC.
I had the following in requirements.txt
cryptography==2.8
I removed the version and kept only cryptography in requirements.txt file like below
cryptography
Saved the requirements.txt and then I ran
pip install -r requirements.txt
It installed successfully.
Then I freeze the requirements.txt by running the following command
pip freeze > requirements.txt
Then the requirements.txt got updated with cryptography==3.1.1
Had also this issue. If you're using alpine, make sure that all dependencies for cryptography are installed.
In my case the cargo package was missing and causing the issue.
sudo apk add gcc musl-dev python3-dev libffi-dev openssl-dev cargo
https://cryptography.io/en/latest/installation.html#building-cryptography-on-linux
Ran into this issue, and the solution is actually in the message when pip attempts to install openssl before cryptography:
generating cffi module 'build/temp.linux-x86_64-3.7/_openssl.c'
running build_rust
=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation.html for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq.html
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation.html#rust
5) If you are experiencing issues with Rust for *this release only* you may
set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
=============================DEBUG ASSISTANCE=============================
Simply running the pip update command appeared to work for me:
pip install -U pip
Which updated pip from version 18.0 to version 21.0.1
I faced this issue on macOS Monterey (version 12.2.1) Apple M1 Pro. I followed Cryptography installation documentation and it helped me resolve the issue.
brew install openssl#1.1 rust
env CRYPTOGRAPHY_SUPPRESS_LINK_FLAGS=1 LDFLAGS="$(brew --prefix openssl#1.1)/lib/libssl.a $(brew --prefix openssl#1.1)/lib/libcrypto.a" CFLAGS="-I$(brew --prefix openssl#1.1)/include" pip3 install cryptography
You can use the lastest version with
python3 -m pip install --no-use-pep517 cryptography
worked for me with ubuntu:18.04 on arm32v7
(instead as suggested by the error message install the full rust compiler and build-essentials, or upgrading pip (what had no effect on ubuntu:18.04 on my armbian))
pip install --upgrade pip
Try to upgrade pip of your environment working fine for me.
I got this error trying to install Scrapy with Python 3.8.1 on Windows 10, but its solved installing the last version of pip (19.3.1 in my case) and all works using pip in this way:
python -m pip install scrapy --user
I have faced same issue and tried to install openssl with mentioned step but still was not able to proceed for windows 10. Later I upgraded pip to latest version and tried again and it worked without any issue.
I would recommend to upgrade pip to latest version and give a try before proceeding for installing openssl
I had the same issue. pip3 version was 19.* after upgrade it works
sudo -H pip3 install --upgrade pip
You can try to install cryptography==3.1.1 package instead of cryptography 35 version.
pip install cryptography==3.1.1
If still you are facing challenges in cryptography package integration.
You can resolve that by the following steps.
python -m pip install --upgrade pip
sudo pip install -U pip setuptools
I had this problem and i just installed rust and problem fixed for me
You can install end version of cryptography after installing rust programming languege(dont try pip install rust, its not python package)
https://www.rust-lang.org/tools/install
Just updating pip
python -m pip install --upgrade pip
I did not install the latest version of Scrapy, then it worked for me. Instead of installing version 2.6.3, I installed 2.6.2:
pip install Scrapy==2.6.2
I use PyCharm 2022.2.3 (Professional Edition) on Windows.
I'm trying to install the google-cloud-speech python API for raspberry pi 3 (raspbian Jessie) using pip (1.5.6). I follow the instructions given by:
https://cloud.google.com/speech-to-text/docs/reference/libraries?authuser=1#client-libraries-install-python
but when installing the library using pip:
pip install --upgrade google-cloud-speech
I get this error:
error in grpcio setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers
and the installation doesn't finish. The same job worked for me some months ago, so I guess some changes was made. Any ideas?
I've already tried upgrading pip
Start with upgrading installation tools:
pip install --upgrade setuptools pip
Upgrade your setup tools/ pip
pip install setuptools -U
Thank you all! now it is working. I'm pretty sure I tried before one of:
pip install --upgrade setuptools pip
pip install setuptools -U
But the thing is that executing both of them the installation finished correctly.
I want to install tensorflow, but I need to upgrade pip. How to upgrade pip? I tried to upgrade through the command line and this is what I got.
C:\Users\garoo>python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/d8/f3/413bab4ff08e1fc4828dfc59996d721917df8e8583ea85385d51125dceff/pip-19.0.3-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\\program files (x86)\\python36-32\\lib\\site-packages\\pip-10.0.1.dist-info\\entry_points.txt'
Consider using the `--user` option or check the permissions.
You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\garoo>python -m pip install --upgrade pip
To upgrade pip from the command line:
python -m pip install --upgrade pip
You do not need to upgrade pip to install tensorflow. Although if you still wish to do so you can try this
pip install --user --upgrade pip
Else try running the CMD as Admin
For permission error while installing Python dependencies, you need to run the terminal or command prompt or powershell as administrator
Example below:
How to upgrade pip using command prompt:
Open the command prompt from the Start Menu
Click the lower-left Start button to open the Start Menu
input cmd in the empty box and tap Command Prompt in the results
Use python -m pip install --upgrade pip to uninstall the old pip package and install the current version.
Collecting pip
Downloading pip-22.0.4-py3-none-any.whl (2.1 MB)
---------------------------------------- 2.1/2.1 MB 284.1 kB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 22.0.3
Uninstalling pip-22.0.3:
Successfully uninstalled pip-22.0.3
Successfully installed pip-22.0.4
Adding up to #Iain Hunter's answer, if the command prompt provides you with an error:
'python' is not recognized as an internal or external command,
operable program or batch file.
Try changing python -m pip install --upgrade pip to py -m pip install --upgrade pip. If cmd still provides you the error, try downloading Python once again; Maybe you accidentally unchecked the download pip box while downloading Python.
m pip install --upgrade pip
Write this clause on terminal and press Enter
m pip install --upgrade pip
Im trying to install google assistant on my Raspberry Pi, but when I keep getting an error: pip is a package and cannot be directly executed
Instead of
pip [...]
Try doing
python -m pip [...]
Can't really help more without more info.
I think your version of pip is old. You need to upgrade it first, like this:
pip install -U pip
You may need to upgrade setuptools too:
pip install -U setuptools
Since google-assistant-library is available as a wheel, you need to install wheel too:
pip install wheel
I don't know if you can do that with Raspberry Pi, but I recommend you to used a virtualenv. That way, you have a fresh and isolated Python executable and a recent version of pip.
virtualenv your_proj
source your_proj/bin/activate
pip install wheel
pip install google-assistant-library
For newer version ie. using pip3:
pip3 install -U <<package name>>
I had the same problem.
I think it was an outcome of a failed
> .\python.exe -m pip install --upgrade pip
do to some environment misconfiguration.
So it first removed the existing version 10.0.1, and then the installation of the new version 22.3.1 failed, leaving me with no pip.
From official documentation, I ran
> .\python.exe -m ensurepip --upgrade
which restored the original pip 10.0.1.
Then I fixed the environment problem, and then again
> .\python.exe -m pip install --upgrade pip
I now have pip 22.3.1.