Error while installing JupyterLab with pip Windows - pip

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!

Related

How can I solve this installation problem with fastavro on Mac?

I am trying to run in my Mac a Python program which requires working with .avro binary files.
Despite trying to install it by using: pip install fastavro, I always get an error message on the terminal that ends with the following lines:
...
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for fastavro
Failed to build fastavro
ERROR: Could not build wheels for fastavro, which is required to install pyproject.toml-based projects
I have updated conda to its latest version on my PC as well as updated pip as well.
Does anyone know how to solve this? I really need to run this program on Mac as soon as possible. For your information, I am able to install and use fastavro on Windows but not on Mac so this is likely to be a Mac-specific problem.
Thanks a lot
Since you are working in a conda environment, why not install it with conda? I often find installations via conda much more convenient since it takes care of all non-Python dependencies as well.
So try uninstalling the package first with pip: pip uninstall fastavro and then installing it via conda: conda install fastavro -c conda-forge.
In case you are unfamiliar with the -c conda-forge flag, it tells conda to look for the package on the conda-forge channel which has almost all packages that are not available via the standard channels.

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

import torch OSError: [WinError 127]

I'm trying to install torch-gpu. I have installed cuda 11.1 and installed torch via the command pip3 install torch==1.8.1+cu111 torchvision==0.9.1+cu111 torchaudio===0.8.1 -f https://download.pytorch.org/whl/torch_stable.html
It is so stupid but during the importing I have the following error OSError: [WinError 127] Error loading "C:\Users\User\AppData\Roaming\Python\Python38\site-packages\torch\lib\c10_cuda.dll" or one of its dependencies..
c10_cuda.dll exists in that directory, I spent several days and still can't solve it. I need torch-gpu and that's the point of using that possibility, please, do not comment 'install torch-cpu'.
Answering the question myself
To install torch-gpu one should:
check the latest (or not) versions and compatible cuda version: https://pytorch.org/get-started/locally/, at this moment it is 11.1.
download and install cuda of the established version in 1) step (https://developer.nvidia.com/cuda-toolkit-archive). That depends on the gpu, if any problems you may download older versions or maybe you have it installed? then you can check version manually in the command line: nvcc --version.
install torch using commands as found in the 1) step (for instance conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge)
check the installation success as import torch torch.cuda.is_available().
In my case I had to delete previously installed torch pip uninstall torch and use conda clean -a for installation to end successfully.

Kernel Error in R Jupyter Notebook due to Anaconda?

I need to bundle R scripts into some Notebook such as Jupyter Notebook. My OSX setup contains Homebrew, Rstudio and Anaconda. Next I try to get R in Jupyter Notebook working. I am getting the following error
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/Cellar/r/3.3.3_1/R.framework/Resources/bin/R': '/usr/local/Cellar/r/3.3.3_1/R.framework/Resources/bin/R'
that shows that paths are somehow messed up. Also, the Jupyter Notebook shows Kernel Error in Red. The path /Users/hhh/anaconda3/envs/ is a Anaconda path so this must be an issue with Anaconda and Jupyter Notebook.
How to get R running in Jupyter Notebook under Conda? How to resolve the Kernel error?
Questions separated about potential Conflicts
Potential conflicts due to Homebrew and Anaconda here.
Your conda manages your bindings to R. You need to install the IRkernel package via conda such that
$ conda install -c r r-irkernel
to resolve the error.

Unable to install Image package in Python (Windows) - zlib is required

I am using PyCharm with Python 3.0 and I want to import Image Module.
While installing the Image module from Project Interpreter, I got a message which says:
ValueError: zlib is required unless explicitly disabled using --disable-zlib, aborting.
Screenshot
There is no package named Zlib to install.
I tried to find several solution, but most of them are for Linux. for example, this solution: no module named zlib
How can I solve this issue in Windows and with PyCharm ?
easy_install Pillow
- this will install dependencies automatically
I had the same error when I wanted to install Mezzanine.
Solution was to install pillow by
- downloading the Windows package from https://pypi.python.org/pypi/Pillow/3.4.2, and
- installing with "pip install .
Please make sure that you download the correct pillow package for your Python version.
After that, I could install Mezzanine without error.

Resources