How to pip in SageMaker Studio Lab - pip

enter image description here
I want to pip matminer in the jupyter lab but failed. If someone knows why and how to fix the problem
ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/home/studio-lab-user/.conda/envs/default/lib/python3.9/site-packages/numpy-1.22.1.dist-info/METADATA'

I just ran it with no problems
%pip install matminer --user
I did use a % instead of a ! per the best practices.

Related

OSError when tried to load librosa (import soundfile error)

When I ran import librosa, I got the following error message:
OSError: cannot load library 'C:\ProgramData\Anaconda3\Library\bin\sndfile.dll': error 0x7e
and
OSError: cannot load library 'C:\ProgramData\Anaconda3\lib\site-packages\_soundfile_data\libsndfile64bit.dll': error 0x7e.
I installed librosa package with conda install -c conda-forge librosa, pysound with conda install -c conda-forge pysoundfile, and soundfile with pip install SoundFile.
But this didn't solve the problem.
Does anyone got a similar error or know how to fix this?
Update: I created a new environment on anaconda and installed librosa. This fixed the loading issue, but I'm wondering if there's a way to fix this issue in my base environment.
It may seem as a brute force approach but uninstalling and then installing the same module worked for me

Error while installing JupyterLab with pip Windows

I face the below error while trying to install package dependencies for JupyterLab via pip.
Installing collected packages: jedi, ipython, ipykernel, notebook, jupyterlab-server, jupyterlab
ERROR: Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: 'C:\\Users\\<Username>\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python37\\site-packages\\jedi\\third_party\\typeshed\\third_party\\2and3\\requests\\packages\\urllib3\\packages\\ssl_match_hostname\\_implementation.pyi'
EDIT : All these packages have dependencies on Jedi, and I'm unable to install Jedi. Can someone help how I can remove this SSL hostname error?
The issue was with the pathname being too long. Uninstalled and reinstalled python, removed restriction on path variable length. And done, solved.
When you are installing Python is important to "Disable path length limit" , and that it's!

How can I upgrade pip when there is a folder missing in the path it's trying to access?

I keep receiving the following message:
You are using pip version 10.0.1, however version 19.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
However, when I try, I am met with this error:
Could not install packages due to an EnvironmentError: [Errno 2] No such file or directory: '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/.umpy-1.15.4.dist-info/METADATA'
I had several errors exactly like this, and I noticed that METADATA was in the right place, but that there was an additional folder that was not included in the path above. I was able to get around this by moving METADATA out from the extra folder and into the folder listed in the error message above.
However, when I try to do that with this path, I notice the .umpy-1.15.4.dist-info directory does not even exist.
I struggling to understand if there's an easier way to accomplish this, or if I have messed up with my installation to being with.
first of all, before doing anything, always have a backup copy of pip which is generally in pythonxxx/Lib/site-packages
you can try below command
python3 -m pip install --upgrade pip
it will install updated pip and keep existing pip packages

Changing pip installation path; OSError: [Errno 20] Not a directory

For context, I'm trying to point pip at the directory that PyCharm is using. Running OSX High Sierra. Google hasn't had any answers yet (As far as I can tell).
In the command line, if I enter
pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/site-packages
It gives me
OSError: [Errno 20] Not a directory
If I try
pip install SpeechRecognition -t /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4/
I get
ERROR: Target path exists but is not a directory, will not continue.
I tried updating pip, and still no luck. What should I try next?
The target dir you're trying to specify is incorrect - it should be
/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
(lib dir instead of bin that stores the executables).
However, it looks like you are trying to install into the python dist's default site packages dir - you shouldn't need to explicitly specify the target dir in this case. Instead, use the correct pip executable:
$ pip3.4 install SpeechRecognition
If pip3.4 executable is not available, use the one bundled with Python 3.4:
$ python3.4 -m pip install SpeechRecognition

Environment error when installing with pip

I'm trying to install some python libraries with pip and I'm getting a repeated error when running it. For example, if I run pip install -U py2app the download appears to proceed as normally, but then an error is raised:
Could not install packages due to an EnviromentError
Which is followed by a series of [Errno 1] Operation not permitted errors (with directories listed after each error).
This error has appeared a number of times on several different libraries I've attempted to install, and it's extremely frustrating. I've tried to update the tools that people have recommended to update for various pip errors and none of them have made any difference.
Is there an easy fix to this problem?
Try to install using the option --user for example:
$ pip install --user py2app
Passing the --user option will install a package just for the current user, rather than for all users of the system.

Resources