PIP3 python pip3 does not work or install property - python

PIP3 does not install!
Meanwhile i was setting my vps i tried to install python3 thorugh repositories and it did worked but i wasn't lucky for pip3. please help.
I got this:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
File "/usr/lib/python3/dist-packages/pip/__init__.py", line 22, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 73, in <module>
vendored("pkg_resources")
File "/usr/lib/python3/dist-packages/pip/_vendor/__init__.py", line 33, in vendored
__import__(modulename, globals(), locals(), level=0)
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/__init__.py", line 77, in <module>
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/packaging/requirements.py", line 9, in <module>
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 672, in _load_unlocked
File "<frozen importlib._bootstrap>", line 632, in _load_backward_compatible
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/extern/__init__.py", line 43, in load_module
File "/usr/share/python-wheels/pkg_resources-0.0.0-py2.py3-none-any.whl/pkg_resources/_vendor/pyparsing.py", line 943, in <module>
AttributeError: module 'collections' has no attribute 'MutableMapping'
I did this:
sudo apt update
sudo apt install python3-pip
pip3 -V

Try running this:
pip3 install --upgrade pip3
pip3 install --upgrade wheel
pip3 install --upgrade setuptools
pip3 install --upgrade requests
should fix it

Related

I am having trouble installing PyDictionary

When I type "pip install PyDictionary" I reserve this error. I also tryed installing the package by typing "python(3) -m pip install PyDictionary" I installed this package before without problems with (python 3.10) but not o n python 3.10.64
enter code here
PS C:\Users\danie\Desktop\pythonProject> pip install PyDictionary
Collecting PyDictionary
Using cached PyDictionary-2.0.1-py3-none-any.whl (6.1 kB)
Collecting goslate
Using cached goslate-1.5.2-py3-none-any.whl
Requirement already satisfied: requests in c:\users\danie\appdata\local\programs\python\python310\lib\site-packages (from PyDictionary) (2.27.1)
Requirement already satisfied: click in c:\users\danie\appdata\local\programs\python\python310\lib\site-packages (from PyDictionary) (8.0.4)
Collecting bs4
Using cached bs4-0.0.1-py3-none-any.whl
Requirement already satisfied: beautifulsoup4 in c:\users\danie\appdata\local\programs\python\python310\lib\site-packages (from bs4->PyDictionary) (4.10.0)
Requirement already satisfied: colorama in c:\users\danie\appdata\local\programs\python\python310\lib\site-packages (from click->PyDictionary) (0.4.4)
Collecting futures
Using cached futures-3.0.5.tar.gz (25 kB)
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [25 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 14, in <module>
File "C:\Users\danie\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\__init__.py", line 18, in <module>
from setuptools.dist import Distribution
File "C:\Users\danie\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py", line 32, in <module>
from setuptools.extern.more_itertools import unique_everseen
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 674, in _load_unlocked
File "<frozen importlib._bootstrap>", line 571, in module_from_spec
File "C:\Users\danie\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\extern\__init__.py", line 52, in create_module
return self.load_module(spec.name)
File "C:\Users\danie\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\extern\__init__.py", line 37, in load_module
__import__(extant)
File "C:\Users\danie\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_vendor\more_itertools\__init__.py", line 1, in <module>
from .more import * # noqa
File "C:\Users\danie\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\_vendor\more_itertools\more.py", line 5, in <module>
from concurrent.futures import ThreadPoolExecutor
File "C:\Users\danie\AppData\Local\Temp\pip-install-cvmk7t7g\futures_bc0e05fe70bf443a80089b769091bce8\concurrent\futures\__init__.py", line 8, in <module>
from concurrent.futures._base import (FIRST_COMPLETED,
File "C:\Users\danie\AppData\Local\Temp\pip-install-cvmk7t7g\futures_bc0e05fe70bf443a80089b769091bce8\concurrent\futures\_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
There's an open issue on the repo currently: I'll attach the link here but give a quick explanation.
https://github.com/geekpradd/PyDictionary/issues/52
There's a dependency for the google translate aspect of the package that depends on Python 2 code. That's causing the package to fail to install on Python 3.10+ (In the dependency repo they explicitly declare that it won't work on Python 3+).
One of the answerers on the github issue said he found a workaround by installing futures before attempting to install PyDictionary

pip fails with python3.10 & python3.11

I have python 3.8 & 3.9 and 3.10 and 3.11 installed, however pip install does not work for 3.10 and 3.11 and only works for the rest simply please observe:
pip3 install jedi
returns:
Requirement already satisfied: jedi in /home/user/.local/lib/python3.8/site-packages (0.17.2)
Requirement already satisfied: parso<0.8.0,>=0.7.0 in /home/user/.local/lib/python3.8/site-packages (from jedi) (0.7.1)
so does:
pip install jedi
returns
Requirement already satisfied: jedi in /home/user/.local/lib/python3.8/site-packages (0.17.2)
Requirement already satisfied: parso<0.8.0,>=0.7.0 in /home/user/.local/lib/python3.8/site-packages (from jedi) (0.7.1)
as well as :
python3.8 -m pip install jedi
results in:
Requirement already satisfied: jedi in /home/c/.local/lib/python3.8/site-packages (0.17.2)
Requirement already satisfied: parso<0.8.0,>=0.7.0 in /home/c/.local/lib/python3.8/site-packages (from jedi) (0.7.1)
However
python3.10 -m pip install jedi
results in :
Traceback (most recent call last):
File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/lib/python3/dist-packages/pip/__main__.py", line 19, in <module>
sys.exit(_main())
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 96, in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 24, in <module>
from pip._internal.cli.req_command import RequirementCommand
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 15, in <module>
from pip._internal.index.package_finder import PackageFinder
File "/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py", line 21, in <module>
from pip._internal.index.collector import parse_links
File "/usr/lib/python3/dist-packages/pip/_internal/index/collector.py", line 12, in <module>
from pip._vendor import html5lib, requests
ImportError: cannot import name 'html5lib' from 'pip._vendor' (/usr/lib/python3/dist-packages/pip/_vendor/__init__.py)
Python versions are managed by alternatives
update-alternatives --query python
which returns:
Name: python
Link: /usr/bin/python
Status: auto
Best: /usr/bin/python3.8
Value: /usr/bin/python3.8
Alternative: /usr/bin/python3.8
Priority: 80
and
update-alternatives --query python3
returns:
Name: python3
Link: /usr/bin/python3
Status: auto
Best: /usr/bin/python3.8
Value: /usr/bin/python3.8
Alternative: /usr/bin/python3.10
Priority: 40
Alternative: /usr/bin/python3.8
Priority: 90
I tried re-installing practically everything including python versions and the modules to no avail.
I am not too sure what is the root of the problem or actually what is the process that leads here, it only does
It's always best to run the pip as a main module with the version of Python you want to install for.
python3.9 -m pip install ...
python3.10 -m pip install ...
python3.11 -m pip install ...
If you want to force an upgrade, use the --upgrade option.
First try to install pygames
PS > py -m pip install pygames
ERROR: Could not find a version that satisfies the requirement
pygames (from versions: none)
ERROR: No matching distribution found for pygames
There is a version conflict. I have many Python versions (2.4 - 3.11) on Windows 11.
py laucher defaults to highest Python version installed.
=> specify py launcher option -xx.yy-ZZ like:
(More info: py --help)
PS > py -3.7-32 -m pip install -U pygame
Collecting pygame
Downloading pygame-2.1.2-cp37-cp37m-win32.whl (8.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
8.1/8.1 MB 1.2 MB/s
Installing collected packages: pygame
Successfully installed pygame-2.1.2
PS > py -3.7-32
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
'>>> from pygame import *'
'>>>'
Happy end!

how to install "pip install rasa", I am getting error

I am getting the below error while i am trying for "pip install rasa". My Python Version is 3.7.8.
Error message :
Requirement already satisfied: python-dateutil<2.9,>=2.8 in c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages (from rasa) (2.8.1)
Collecting colorhash<1.1.0,>=1.0.2
Using cached colorhash-1.0.2-py2.py3-none-any.whl (6.0 kB)
Collecting ujson<3.0,>=1.35
Using cached ujson-2.0.3.tar.gz (7.1 MB)
Installing build dependencies ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\loginname\desktop\2020\chatbot\venv\scripts\python.exe' 'c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip' install --ignore-installed --no-user --prefix 'C:\Users\loginname\AppData\Local\Temp\pip-build-env-nir8n2vw\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (42 lines):
Traceback (most recent call last):
File "C:\Users\loginname\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\loginname\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip\__main__.py", line 26, in <module>
sys.exit(_main())
File "c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip\_internal\cli\main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "c:\users\loginname\desktop\2020\chatbot\venv\lib\site-packages\pip\_internal\commands\__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "C:\Users\loginname\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
$ sudo apt install python3-dev python3-pip
$ python3 -m venv ./venv
$ source ./venv/bin/activate
$ pip install -U pip
$ pip install rasa
https://rasa.com/docs/rasa/user-guide/installation/

I am unable to acquire the newest version of pip

When I try to upgrade my pip, using the command prompt, to the newest version I get the errors in the picture below. Is there an administrative step I have overlooked?
An image of my command prompt is located at this link (I don't have a reputation of 10 which is required to include images).
C:\Users\hassa>python -m pip install --upgrade pip
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 455kB/s
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Exception:
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\shutil.py", line 538, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\anaconda3\\lib\\site-packages\\pip' -> 'C:\\Users\\hassa\\AppData\\Local\\Temp\\pip-uazegy0h-uninstall\\program files\\anaconda3\\lib\\site-packages\\pip'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\req\req_uninstall.py", line 115, in remove
renames(path, new_path)
File "C:\Program Files\Anaconda3\lib\site-packages\pip\utils\__init__.py", line 267, in renames
shutil.move(old, new)
File "C:\Program Files\Anaconda3\lib\shutil.py", line 550, in move
rmtree(src)
File "C:\Program Files\Anaconda3\lib\shutil.py", line 488, in rmtree
return _rmtree_unsafe(path, onerror)
File "C:\Program Files\Anaconda3\lib\shutil.py", line 383, in _rmtree_unsafe
onerror(os.unlink, fullname, sys.exc_info())
File "C:\Program Files\Anaconda3\lib\shutil.py", line 381, in _rmtree_unsafe
os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'c:\\program files\\anaconda3\\lib\\site-packages\\pip\\basecommand.py'
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\hassa>
____________________________________
It appears you are using Anaconda. You should use the conda command to update pip in that case:
conda update pip
If that doesn't work, try opening your cmd.exe as Administrator and try again.

Python virtualenv does not find 'mac_ver' attribute when setup a new env suddenly

This morning, I ran into an issue with Virtualenv on my macbook pro under Yosemite (10.10.3):
$ virtualenv ENV
New python executable in ENV/bin/python2.7
Also creating executable in ENV/bin/python
Installing setuptools, pip, wheel...
Complete output from command /Users/USER/Docu...jp/ENV/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/__init__.py", line 13, in <module>
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/utils/__init__.py", line 23, in <module>
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/__init__.py", line 72, in load_module
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 967, in <module>
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 970, in Environment
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 260, in get_supported_platform
File "/usr/local/lib/python2.7/site-packages/virtualenv_support/pip-7.0.3-py2.py3-none-any.whl/pip/_vendor/pkg_resources/__init__.py", line 424, in _macosx_vers
AttributeError: 'module' object has no attribute 'mac_ver'
----------------------------------------
...Installing setuptools, pip, wheel...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv-3.4", line 9, in <module>
load_entry_point('virtualenv==13.0.3', 'console_scripts', 'virtualenv-3.4')()
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 832, in main
symlink=options.symlink)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 1004, in create_environment
install_wheel(to_install, py_executable, search_dirs)
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 969, in install_wheel
'PIP_NO_INDEX': '1'
File "/usr/local/lib/python2.7/site-packages/virtualenv.py", line 910, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /Users/USER/Docu...jp/ENV/bin/python2.7 -c "import sys, pip; sys...d\"] + sys.argv[1:]))" setuptools pip wheel failed with error code 1
I'm using virtualenv installed with brew:
$ which virtualenv
/usr/local/bin/virtualenv
Note, I'm using fishshell but tried under bash and I have similar symptoms. Uninstalling python, pyenv and virtualenv and starting fresh (with homebrew) didn't solve the problem. What could be the issue? I'm struggling.
Thanks for you help

Categories

Resources