Python 3 - WinError 87 when installing new modules - python-3.x

I'm trying to install new modules in python 3 and when I run python -m pip install filename on my win10 machine then I'm getting:
Using cached https://files.pythonhosted.org/packages/8a/48/a76be51647d0eb9f10e2a4511bf3ffb8cc1e6b14e9e4fab46173aa79f981/termcolor-1.1.0.tar.gz
Error [WinError 87] The parameter is incorrect while executing command python setup.py egg_info
Could not install packages due to an EnvironmentError: [WinError 87] The parameter is incorrect
I tried to run PowerShell as an admin but the problem persists. I also tried to run this command in the cmd.

I received the same error message when executing a pip install numwords2 from the Pycharm console.
I then upgraded pip, using:
python -m pip install --upgrade pip
which uninstalled pip-19.1.1 and replaced it with pip-19.3.1.
The next whack at pip install worked well.

termcolor is quite old, the last release 1.1.0 was in 2011. There is a report that Python 3.6+ broke termcolor.
My recommendation is to try console.

Related

Unable to Install Jupyter due to legacy-install-error with psutil package

I was previously running into environment inconsistencies after downloading tensorflow with pip in a conda environment, and after several hours of frustration, decided deleting anaconda/miniconda and python and starting from scratch would be my best option to get python working again (The inconsistencies were causing a plethora of issues with loading other modules like numpy, etc).
After downloading Python version 3.9.10 directly from https://www.python.org/downloads/macos/, I wanted to see if I could start using Python again in a Jupyter notebook in VS Code. When I try to run a simple print('hello world') in a python chunk I (unsurprisingly) get the following error:
Jupyter cannot be started. Error attempting to locate jupyter: Running cells with 'Python 3.9.10 64-bit' requires notebook package.
Run the following command to install 'jupyter and notebook' into the Python environment.
Command: 'python -m pip install jupyter notebook -U'
I was pretty much expecting this error, since I knew I had deleted all packages when deleting Anaconda and Python.
However, when I try running python -m pip install jupyter notebook -U in the terminal I ultimately get the following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> psutil
note: This is an issue with the package mentioned above, not pip.
Any help or insight is greatly appreciated! I am on MacOS (M1) if that is useful information.
The problem seems to be with the python3 distribution that comes with MacOSX Command Line Tools. Well, at least that same error was gone after following these steps.
So, to fix the problem I installed python3.9 (I presume you can change 3.9 to your desired version, e.g. 3.8 or 3.10) using Homebrew.
Install Homebrew (to check if it's installed already just type brew --version in the terminal):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install python3.9
brew install python#3.9
Create your virtual environment
python3.9 -m venv myvenv
Activate the virtual environment with source myvenv/bin/activate
Finally, install Jupyter using
(myvenv) pip install jupyter notebook
I have the same problem when installing the Jupyter notebook on MacOS 12.5 M2 chip. It turns out that the error is caused by not having GCC on my mac to run the wheel for installing the psutil package because for some reason I removed my XCode from my Mac. So I installed XCode from AppStore and opened XCode after the installation to agree to its terms and conditions. After Xcode went through the setup process I tried pip install jupyter again and it worked well.
In my case, I just opened the XCode, accept the terms and the installation proposed, and tried to install the jupyter again and it worked!
It seems to be very particular about the version of python installed. I set up a fresh installation on a new box this morning and put 3.11 on there. pip install jupyterlabs gave me the same error as you got. I then uninstalled python and installed an earlier version, and now it works.
PS the older version that worked for me is 3.10.8

Error when trying to install oct2py package

I am trying to install to oct2py package to import in my python script. However whenever I run the command pip install oct2py I get the following error:
Fatal error in launcher: Unable to create process using '"c:\python37\python.exe" "C:\Program Files\Python37\Scripts\pip.exe" ': file cannot be found.
How can I install oct2py?
Found the answer
Deinstalled python and reinstalled it. I checked the environment variable and changed it from this one : 'C:\Program Files\Python39' to this one 'C:\Users\lsee\AppData\Local\Programs\Python\Python39'.
Is unable to locate your pip installer, easy fix is unusually to either upgrade or test pip :
# to upgrade your pip
python -m pip install --upgrade pip
pip --version
# test you have pip in your machine
If your pip version is showing that means you have it installed, it could be a problem activating your virtual environnement, or your path.
It says the file cannot be locate, are you sure your path for Python and pip is correct ?
Try:
python -m pip install oct2py
This should work (as python -m pip install gave not errors)

no module named "pip" in python

I am on python 3.8.5 I am using python and pip, pipenv recently without any issue on any terminal and project. But, today when I try to do anything with pip or pipenv, I get this error
No Module Named "pip"
I even installed python latest version again and I know that on 3.8.5, I don't have to download pip. I can't even check the pip version in the terminal.
Type in sudo apt-get install python3-pip in the terminal to install pip

Python Pip doesn't work after updating to 19.3.1

After updating to the newest version of pip (19.3.1) with python 3.7.3, I can no longer use pip. When I run pip install package, I get the following error: TypeError: 'module' object is not callable. When trying to fix this error, I found that a common suggestion was running python -m pip install package. While this fixed my original problem, I get this different error: ModuleNotFoundError: No module named 'pip._vendor.requests._internal_utils'. Keep in mind I am on Windows 10 If anyone can help me, it would be very much appreciated!
I cannot guarantee a solution, here are a few suggestions to try:
pip3 install package
If that doesn't work:
python -m pip install package
If it still does not behave, try the following command which will reinstall pip.
python -m pip install --upgrade --force-reinstall pip
The final option is to uninstall python and reinstall your desired 64bit version of Python.

Upgrade pip from 10 to 18

I am trying to install the robotframework.
I am on a windows machine and on the command line I entered:
pip install robotframework
But pip asks me to upgrade pip from 10 to 18, so I use this command:
python -m pip install --upgrade pip
This resulted in an error message:
Could not install packages due to an EnvironmentError: [WinError 5]
Accès refusé : `c:\\program files (x86)\\python37-32\\lib\\site-packages\\pip-10.0.1.dist-inf o\\entry_points.txt`
Consider using the `--user` option or check the permissions.
How can I fix this?
If you are using a 64 bit version of python I guess this will work for you:
Try opening the command prompt with administrator privileges and update pip from here.

Resources