I'm on Windows with Python 3.6.4 installed. Following the Python documentation I typed following on cmd but got error:
>py -3.6 -m pip install numpy
Traceback (most recent call last):
File "<string>", line 6, in <module>
File "__main__.py", line 126, in <module>
File "__main__py__.py", line 60, in <module>
IOError: [Errno 2] No such file or directory: '-3.6'
Python 3.6.exe is in my system PATH. What am I missing here?
Related
pip3 isntall netmiko
#downloads all requirements (into cashe) but gives this error.
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/pyasn1-0.4.7.dist-info'
Consider using the `--user` option or check the permissions.
I tried using sudo pip3 install netmiko,
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 109, in apport_excepthook
pr.add_proc_info(extraenv=['PYTHONPATH', 'PYTHONHOME'])
File "/usr/lib/python3/dist-packages/apport/report.py", line 543, in add_proc_info
self.add_proc_environ(pid, extraenv)
File "/usr/lib/python3/dist-packages/apport/report.py", line 610, in add_proc_environ
env = _read_file('environ', dir_fd=proc_pid_fd).replace('\n', '\\n')
File "/usr/lib/python3/dist-packages/apport/report.py", line 73, in _read_file
with open(path, 'rb', opener=lambda path, mode: os.open(path, mode, dir_fd=dir_fd)) as fd:
File "/usr/lib/python3/dist-packages/apport/report.py", line 73, in <lambda>
with open(path, 'rb', opener=lambda path, mode: os.open(path, mode, dir_fd=dir_fd)) as fd:
TypeError: argument should be integer or None, not list
Original exception was:
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
the only way it works is by
sudo apt-get update
pip3 install netmiko --user
then I have to reboot (from terminal) to get it working.
This happened to every module I installed,is there a fix to this?
I am running the default python 3.6.8 (preinstalled on Ubuntu 18)
I am getting the following error when executing this command "sudo pip install django"
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip._internal import main
File "/usr/lib/python2.6/site-packages/pip/_internal/__init__.py", line 42, in <module>
from pip._internal import cmdoptions
File "/usr/lib/python2.6/site-packages/pip/_internal/cmdoptions.py", line 16, in <module>
from pip._internal.index import (
File "/usr/lib/python2.6/site-packages/pip/_internal/index.py", line 526
{str(c.version) for c in all_candidates},
^
SyntaxError: invalid syntax
And python installed version is Python 2.7.11 using this command python -V
My system is Windows 10 x64
Now I would like to install pyicu but I encounter with a problem like this
Collecting pyicu
Using cached PyICU-1.9.7.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "C:\Users\ANHVU\AppData\Local\Temp\pip-build-v5fb9ri4\pyicu\setup.py", line 12, in
ICU_VERSION = os.environ['ICU_VERSION']
File "C:\Users\ANHVU\AppData\Local\Programs\Python\Python35\lib\os.py", line 725, in getitem
raise KeyError(key) from None
KeyError: 'ICU_VERSION'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\ANHVU\AppData\Local\Temp\pip-build-v5fb9ri4\pyicu\setup.py", line 26, in <module>
ICU_VERSION = check_output(('icu-config', '--version')).strip()
File "C:\Users\ANHVU\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 316, in check_output
**kwargs).stdout
File "C:\Users\ANHVU\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 383, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\ANHVU\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "C:\Users\ANHVU\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 955, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ANHVU\AppData\Local\Temp\pip-build-v5fb9ri4\pyicu\setup.py", line 33, in <module>
''')
RuntimeError:
Please set the ICU_VERSION environment variable to the version of
ICU you have installed.
How can I resolve this? Help me pls.
You can download a corresponding whl file from Unofficial Windows Binaries for Python Extension Packages
For example, the latest version (as of Jan 13 2019) for your 64-bit Windows and Python3.7 version is PyICU‑2.2‑cp37‑cp37m‑win_amd64.whl
Then open the Windows Powershell console as Administrator, cd to the directory where you put the whl file and execute the following command:
python -m pip install .\PyICU‑2.2‑cp37‑cp37m‑win_amd64.whl
or (if you already have a previous PyICU version installed)
python -m pip install -U .\PyICU‑2.2‑cp37‑cp37m‑win_amd64.whl
For the record:
My system (Win 10, 64 bit, python 3.8) gave me the exact same error message.
The solution was to install the 32-bit version of the PyICU whl file, not the 64 bit version.
I had python pip installed and it was working fine but I did something wrong now it is broken.
Now when I execute pip command to install new packages, I get an error.
like if execute pip list then I get the below error.
root#dragonwarrior-Latitude-3440:~# pip list
Traceback (most recent call last):
File "/usr/local/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python2.7/dist-packages/pip/__init__.py", line 4, >in <module>
import locale
File "/usr/lib/python2.7/locale.py", line 15, in <module>
import encodings
ImportError: No module named encodings
tox runs my Python 2.7 tests, but fails for Python 3.4. It gives an "Invocation failed" message. Excerpts:
py34 create: /home/josh/code/ezoutlet/.tox/py34
ERROR: invocation failed (exit code 1), logfile: /home/josh/code/ezoutlet/.tox/py34/log/py34-0.log
ERROR: actionid: py34
msg: getenv
cmdargs: ['/usr/bin/python', '-m', 'virtualenv', '--python', '/usr/bin/python3.4', 'py34']
And later
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 8, in <module>
import base64
File "/usr/lib/python3.4/base64.py", line 9, in <module>
import re
File "/usr/lib/python3.4/re.py", line 336, in <module>
import copyreg
File "/usr/local/lib/python2.7/dist-packages/copyreg/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 53, in apport_excepthook
if not enabled():
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 24, in enabled
import re
File "/usr/lib/python3.4/re.py", line 336, in <module>
import copyreg
File "/usr/local/lib/python2.7/dist-packages/copyreg/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Original exception was:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 8, in <module>
import base64
File "/usr/lib/python3.4/base64.py", line 9, in <module>
import re
File "/usr/lib/python3.4/re.py", line 336, in <module>
import copyreg
File "/usr/local/lib/python2.7/dist-packages/copyreg/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
Running virtualenv with interpreter /usr/bin/python3.4
ERROR: InvocationError: /usr/bin/python -m virtualenv --python /usr/bin/python3.4 py34 (see /home/josh/code/ezoutlet/.tox/py34/log/py34-0.log)
You need to look at the details of the error message. Notice the command that failed (from the first excerpt):
cmdargs: ['/usr/bin/python', '-m', 'virtualenv', '--python', '/usr/bin/python3.4', 'py34']
You can run this manually with:
/usr/bin/python -m virtualenv --python /usr/bin/python3.4 py34
Assuming you see the same error, your issue is with virtualenv rather than tox.
I reviewed the virtualenv help page and it seems like this should work. Faced with a possible bug, a good first step is to upgrade Python, virtualenv, or other libraries.
In my case, upgrading virtualenv was the solution:
pip install --upgrade virtualenv
Interestingly, this solution worked on both Windows and Linux. Most likely, there was a bug fix between when I got virtualenv and the latest release.