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
I created a virtual environment of python on my Windows computer. I successfully downloaded GDAL 2.4.1 and linked it to python, I am trying to install Fiona using
pip install fiona
but I get this:
ERROR: Complete output from command python setup.py egg_info:
ERROR: A GDAL API version must be specified. Provide a path to gdal-config using a GDAL_CONFIG environment variable or use a GDAL_VERSION environment variable.
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in
C:\Users\marcb\AppData\Local\Temp\pip-install-dua0wlxg\fiona\
Any thoughts on what to do? I need to use the virtualenv and not conda (I already have it successfully installed on anaconda)
I'm trying to install pandas in my windows 10 64bit computer. I already installed python 3.8.0 from the follwing link.
https://www.python.org/downloads/windows/
I tried to install pandas by pip install pandas command.
But I couldn't install pandas due to the following error. Can someone help me to solve this error?
When I tried to install numpy by pip install numpy I'm getting the following error.
Based on the Traceback calls, install the Microsoft Visual C++, followed by the installation of NumPy and Pandas library.
You or others facing the same problem can also proceed by installing Anaconda which has all the built-in libraries in it.
I want to install fastkde library and I did actually everything on web but I am yet able to install this. I constantly get this error in terminal:
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-4ff4dzcb/fastkde/
Can anybody help me with this?
If you've pip installed which is true for all distributions downloaded from here, then just key in the commands in your terminal given below.
pip3 install fastkde
I am working on windows 8.1 .When i try to install some python(python 3.4) modules and packages like IMDBPY using pip :
pip install imdbpy
I get the following error code:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ISHAN~1.
NIT\AppData\Local\Temp\pip-build-uyc40bdk\imdbpy.
This same error message is occurring with many python modules and packages.
Although i have checked other similar questions on stack overflow but they could not solve my problem.