I have installed python 3.6.0, you don't need to install pip manually if you are using python (>3.3). But When I am trying to access pip (pip --version), it throws me two errors which mainly relate to not finding the module.
Description is given below.
C:\Users\sharma6>pip --version
Traceback (most recent call last):
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 27, in <module>
from . import urllib3
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 7, in <module>
from socket import error as SocketError, timeout as SocketTimeout
File "c:\python360\lib\socket.py", line 49, in <module>
import _socket
zipimport.ZipImportError: can't find module '_socket'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python360\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\python360\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\python360\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\python360\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "c:\python360\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "c:\python360\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ModuleNotFoundError: No module named 'urllib3'
Even when I import socket (>>>import socket)in python interpreter , It shows me "Can not found the module" error .
>>> import socket
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\python352\lib\socket.py", line 49, in <module>
import _socket
zipimport.ZipImportError: can't find module '_socket
Could someone tell me about the errors and how to resolve them because I need pip to work properly.
Add your all path in your system variable instead of adding in user variable.
It worked for me!!! :)
You should try to write
python -m pip --version
If this gives an error message, install pip by downloading get-pip.py from https://pip.pypa.io/en/stable/installing/ and install with
python get-pip.py
Installing with pip is then done by
python -m pip install [package name]
Related
I have tried upgrading Python version on a Miniconda installation by running conda update python. The version was being taken from 3.8 to 3.10. This seems to have broken the installation. No matter what command I run, I get the following:
➜ project conda activate
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 13, in <module>
import ruamel_yaml as yaml
ModuleNotFoundError: No module named 'ruamel_yaml'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 16, in <module>
import ruamel.yaml as yaml
ModuleNotFoundError: No module named 'ruamel'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/user/miniconda3/bin/conda", line 15, in <module>
sys.exit(main())
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/cli/main.py", line 118, in main
from ..exceptions import conda_exception_handler
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/exceptions.py", line 24, in <module>
from .models.channel import Channel
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/models/channel.py", line 17, in <module>
from ..base.context import context, Context
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/base/context.py", line 55, in <module>
from ..common.configuration import (Configuration, ConfigurationLoadError, MapParameter,
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/configuration.py", line 42, in <module>
from .serialize import yaml_round_trip_load
File "/home/user/miniconda3/lib/python3.10/site-packages/conda/common/serialize.py", line 18, in <module>
raise ImportError("No yaml library available. To proceed, conda install ruamel_yaml")
ImportError: No yaml library available. To proceed, conda install ruamel_yaml
Help on fixing this is appreciated.
Tried anaconda today , it seems fine but when I tried to launch Spyder each time I get this error: Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\Scripts\spyder-script.py", line 6, in <module>
from spyder.app.start import main
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\app\start.py", line 23, in <module>
from spyder.utils.external import lockfile
File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\external\lockfile.py", line 22, in <module>
import psutil
File "C:\Users\Jaker\AppData\Roaming\Python\Python36\site-packages\psutil\__init__.py", line 126, in <module>
from . import _pswindows as _psplatform
File "C:\Users\Jaker\AppData\Roaming\Python\Python36\site-packages\psutil\_pswindows.py", line 16, in <module>
from . import _psutil_windows as cext
ImportError: cannot import name '_psutil_windows'
Any help regarding this ? Also how do I get python 3.6.3 in anaconda..?
The problem is you have two Python versions installed in your system: one in C:\ProgramData\Anaconda3\ and the other in C:\Users\Jaker\AppData\Roaming\Python\Python36.
Please uninstall one of them and the problem will be solved.
This question already has answers here:
Python: pip is installed but not working in windows
(2 answers)
Closed 5 years ago.
I am trying to install a python gui automator and am supposed to do so through pip. Typing pip install pyautogui in the command prompt (as administrator) gives me many exceptions. Here is the printout:
pip install pyautogui
Traceback (most recent call last):
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 27, in <module>
from . import urllib3
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\__init__.py", line 8, in <module>
from .connectionpool import (
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 7, in <module>
from socket import error as SocketError, timeout as SocketTimeout
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\socket.py", line 49, in <module>
import _socket
zipimport.ZipImportError: can't find module '_socket'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Nate4\AppData\Local\Programs\Python\Python36-32\Scripts\pip.exe\__main__.py", line 5, in <module>
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\site-packages\pip\__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\requests\__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "c:\users\nate4\appdata\local\programs\python\python36-32\lib\site-packages\pip\_vendor\requests\packages\__init__.py", line 29, in <module>
import urllib3
ModuleNotFoundError: No module named 'urllib3'
1) Go to the directory where your python is installed. (In my case it's C:\Users...\AppData\Local\Programs\Python\Python36-32)
2) Find the directory called "Scripts"
3) Hold down SHIFT and right-click on that folder. Then click "Open command window here"
4) A command prompt window will pop up. Type pip install <packagename> and press ENTER.
This method works for me when I install packages for my python through pip. Hope it helps you.
I just cannot use jupyter notebook. I have updated to the most recent version by ananota, and it still does not work.
The error message is listed below:
C:\Users\willian>jupyter notebook
Traceback (most recent call last):
File "C:\Anaconda3\Scripts\jupyter-notebook-script.py", line 3, in <module>
import notebook.notebookapp
File "C:\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 40, in <module>
ioloop.install()
File "C:\Anaconda3\lib\site-packages\zmq\eventloop\ioloop.py", line 207, in install
from tornado import ioloop
File "C:\Anaconda3\lib\site-packages\tornado\ioloop.py", line 47, in <module>
from tornado.concurrent import TracebackFuture, is_future
File "C:\Anaconda3\lib\site-packages\tornado\concurrent.py", line 34, in <module>
from tornado.util import raise_exc_info, ArgReplacer, is_finalizing
ImportError: cannot import name 'is_finalizing'
From your error it looks like the tornado package is not installed in your environment. Installing tornado with the command below should fix your problem.
pip install tornado
I have python2.7 and python3.5 installed via Macports. I am trying to get neovim up and running and for this I ran
$ sudo pip2 install neovim
$ sudo pip-3.5 install neovim
Which installs the packages into different subdirs of /opt/local/Library/Frameworks/Python.framework/Versions/. Now when running Python 3.5, import neovim tries to load the 2.7 package (which fails), as I can see from the stack trace.
The full error is this:
$ python3.5 -c "import neovim"
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/__init__.py", line 7, in <module>
from .uv import UvEventLoop
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/uv.py", line 5, in <module>
import pyuv
ImportError: No module named 'pyuv'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/asyncio.py", line 19, in <module>
import asyncio
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/__init__.py", line 21, in <module>
from .base_events import *
File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/asyncio/base_events.py", line 18, in <module>
import concurrent.futures
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/__init__.py", line 11, in <module>
from .msgpack_rpc import (ErrorResponse, child_session, socket_session,
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/__init__.py", line 8, in <module>
from .event_loop import EventLoop
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/__init__.py", line 12, in <module>
from .asyncio import AsyncioEventLoop
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/neovim/msgpack_rpc/event_loop/asyncio.py", line 22, in <module>
import trollius as asyncio
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/__init__.py", line 21, in <module>
from .base_events import *
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/base_events.py", line 39, in <module>
from . import coroutines
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/coroutines.py", line 16, in <module>
from . import futures
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/futures.py", line 19, in <module>
from . import executor
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/trollius/executor.py", line 12, in <module>
import concurrent.futures
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/concurrent/futures/_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
What do I have to do in order for Python 2.7 and 3 to coexist peacefully on my system?
I recently had this problem as well, but it was not related to PYTHONPATH, which on my machine was unset. In my situation Python and pip were installed via MacPorts. Cleaning, self-updating MacPorts and then updating pip to the most recent version, and then running the following resolved the issue:
port select --set pip pip35