pip installing matplotlib but while importing showing error message: "DLL load failed while importing _path: %1 is not a valid Win32 application." - winapi

Solve the following issue
tried different installation method like
pip, pip2, pip3
or
Update pip
python -m pip install -U pip
Install scikit-image
python -m pip install -U matplotlib

Related

No module named 'torch' in Jupyter Notebook but it is installed (Mac OS)

So when I try to import torch in jupyter notebook it gives the error no module named 'torch'.
I created a conda environment named "Thesis" where I work in and install my packages.
When I try these commands in my terminal it says the package is installed (see three images below):
torch1
torch2
torch3
I tried many commands to install the package:
pip install torchvision
python3 -m pip install torchvision
conda install pytorch torchvision -c pytorch
I also tried installing the package directly in the jupyter notebook itself via:
import sys
!{sys.executable} -m pip install torchvision
It at least shows something but I got the following dependency error
dependency error
I also created a kernel
ipython kernel install --name "thesis" --user
All did not help and I still receive the error in jupyter notebook.
Does somebody know how to resolve this?
I solved the problem by downloading and activating virtualenv with:
python3 -m pip install virtualenv
virtualenv <my_env_name>
source <my_env_name>/bin/activate
And getting the path in the jupyter notebook by:
import sys
print(sys.executable)
which outputs:
/Users/{username}/opt/anaconda3/bin/python
And installing the packages in the terminal via:
/Users/{username}/opt/anaconda3/bin/python -m pip install {package_name}

Unable to create process using "c:\users\hp\anaconda3\python.exe"

C:\Users\HP\badminton_site\badminton>scrapy shell https://stackoverflow.com/questions/ask
Fatal error in launcher: Unable to create process using '"c:\users\hp\anaconda3\python.exe" "C:\Users\HP\Anaconda3\Scripts\scrapy.exe" shell https://stackoverflow.com/questions/ask: The system cannot find the file specified.
Why it is showing such error in anaconda prompt and command prompt?
Uninstall and reinstall the pip:
python -m pip uninstall pip
python -m pip install --upgrade pip
Update pip
python -m pip install -upgrade pip
i reinstalled the anaconda in another diretory and that worked for me

Jupyter error Consider using the `--user` option or check the permissions

ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/defusedxml-0.6.0.dist-info'
Consider using the --user option or check the permissions.
pip install --user jupyter
the above command doesnt seem to work
I faced sam issue trying to upgrade pip.
I wasn't been able to do that with:
!python -m pip install --upgrade pip
But it run ok with:
!python -m pip install --upgrade --user pip
For installing Jupyter Notebook
try using:
pip install --user notebook
instead of:
pip install notebook
If you have root access you can try:
sudo pip install jupyter

Python 3.5: Error installing Beautifulsoup library

I'm trying to install Beautifulsoup library from python 3.5 following the next steps:
Upgrade pip: python -m pip install --upgrade pip
Install setuptools python -m pip install -U pip setuptools
Install Beautifulsoup python -m pip install beautifulsoup
My operating system is Windows 10, 64 bit. And the result that I've got is this error:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\JOSCAR~1\AppData\Local\Temp\pip-build-dgi2w24s\beautifulsoup\
Screenshot:
What am I doing wrong?
I have found the solution to my problem. I was trying to install it using this command:
python -m pip install beautifulsoup
And this is not correct. To install it correctly the comand is ...
python -m pip install beautifulsoup4

Cannot install pip for python3 on mac

When I run
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python3 get-pip.py
It gives me this error:
Downloading/unpacking pip
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement pip
Cleaning up...
No distributions at all found for pip
Storing debug log for failure in /var/root/.pip/pip.log
However if I just run:
sudo python get-pip.py
There is no problem:
Downloading/unpacking pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-1.5.2-py2.py3-none-any.whl#md5=445a893564065937c0f31ac2cc8e2f35
Downloading pip-1.5.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Installing collected packages: pip
Found existing installation: pip 1.5.1
Uninstalling pip:
Successfully uninstalled pip
Successfully installed pip
Cleaning up...
Can anyone help please? Thanks!
This is a simple permissions issue. If you're installing to the system Python installation, you should need root, which is what sudo provides.
If you need to install stuff where you don't have root privileges, you need to look into Python virtual environments.

Resources