pip install for windows running into anaconda error - python

I am trying to pip install pyrtlsdr for the software defined radio RTL-SDR (RTL2832U), but am running into issues with anaconda I believe. I am receiving two errors in cmd, although I am getting the same response through cygwin and cmder. I am running the following command:
pip install pyrtlsdr
However, when I run this command, I see the following error:
pip install pyrtlsdr
Collecting pyrtlsdr
Using cached pyrtlsdr-0.2.4-py2.py3-none-any.whl
Installing collected packages: pyrtlsdr
Exception:
Traceback (most recent call last):
File "C:\Program Files\Anaconda2\lib\site-packages\pip\basecommand.py",
line 215, in main
status = self.run(options, args)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\commands\install.py",
line 317, in run
prefix=options.prefix_path,
File "C:\Program Files\Anaconda2\lib\site-packages\pip\req\req_set.py", line
742, in install
**kwargs
File "C:\Program Files\Anaconda2\lib\site-packages\pip\req\req_install.py",
line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\req\req_install.py",
line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Program Files\Anaconda2\lib\site-packages\pip\wheel.py", line 346,
in
move_wheel_files
clobber(source, lib_dir, True)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\wheel.py", line 317,
in
clobber
ensure_dir(destdir)
File "C:\Program Files\Anaconda2\lib\site-packages\pip\utils\__init__.py",
line 83, in ensure_dir
os.makedirs(path)
File "C:\Program Files\Anaconda2\lib\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 5] Access is denied: 'C:\\Program
Files\\Anaconda2\\Lib\\site-packages\\pyrtlsdr-0.2.4.dist-info'
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.
What exactly is wrong here? I do not know how to force privileges in this file that I think is causing issues, additionally, I also do not know why I am receiving the same error when I run the suggested upgrade in this error.

Try running the cmd line as administrator, this should give write privilege to C drive.

Related

Python 3.7 - PIP upgrade error on windows 10

I tried to update PIP (Windows 10, Python 3.7.1) in console using command:
python37 -m pip install --upgrade pip
This is an error I got everytime I try to update it:
>Exception:
Traceback (most recent call last):
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\req\req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\wheel.py", line 462, in move_wheel_files
generated.extend(maker.make(spec))
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\5gyblo\AppData\Roaming\Python\Python37\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
AttributeError: 'NoneType' object has no attribute 'bytes'
Surprising fact - I had succesfully updated PIP on Python 2.7 isntance without any problems.
I faced this error while trying to upgrade from pip version 18.1 to 19.0.3.
After a lot of search I hit the solution at https://packaging.python.org/tutorials/installing-packages/
(If that still doesn’t allow you to run pip:
Securely Download get-pip.py [1]
Run python get-pip.py. [2] This will install or upgrade pip. Additionally, it will install setuptools and wheel if they’re not installed already.)
The link there takes you to:
Use https://bootstrap.pypa.io/get-pip.py
Download and save the file, run it from command prompt. It worked like a charm for me.
You can try:
python -m pip install -U --force-reinstall pip

How to correct my python3 environment on Ubuntu 16.04 (64 bit)

I tried to install the mysql connector for my python environment.
I use python on my Linux (Ubuntu 16.04) machine.
On this machine python 2.7.12 and python 3.5.2.
I probably messed something up because of my inexperience with installing new python modules.
When I now try to install the mysql connector with the command
pip3 install mysql-connector-python-rf
I get the following messages:
Collecting mysql-connector-python-rf Downloading
mysql-connector-python-rf-2.2.2.tar.gz (11.9MB)
100% |████████████████████████████████| 11.9MB 131kB/s Building wheels for collected packages: mysql-connector-python-rf Running
setup.py bdist_wheel for mysql-connector-python-rf ... done Stored
in directory:
/home/claude/.cache/pip/wheels/bb/53/e4/dced82f8a15f96a8afbe626ebb2939d2901b29e610a97fc1ba
Successfully built mysql-connector-python-rf Installing collected
packages: mysql-connector-python-rf Exception: Traceback (most recent
call last): File
"/home/claude/.local/lib/python3.5/site-packages/pip/basecommand.py",
line 215, in main
status = self.run(options, args) File "/home/claude/.local/lib/python3.5/site-packages/pip/commands/install.py",
line 342, in run
prefix=options.prefix_path, File "/home/claude/.local/lib/python3.5/site-packages/pip/req/req_set.py",
line 784, in install
**kwargs File "/home/claude/.local/lib/python3.5/site-packages/pip/req/req_install.py",
line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix) File
"/home/claude/.local/lib/python3.5/site-packages/pip/req/req_install.py",
line 1064, in move_wheel_files
isolated=self.isolated, File "/home/claude/.local/lib/python3.5/site-packages/pip/wheel.py", line
345, in move_wheel_files
clobber(source, lib_dir, True) File "/home/claude/.local/lib/python3.5/site-packages/pip/wheel.py", line
316, in clobber
ensure_dir(destdir) File "/home/claude/.local/lib/python3.5/site-packages/pip/utils/init.py",
line 83, in ensure_dir
os.makedirs(path) File "/usr/lib/python3.5/os.py", line 241, in makedirs
mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.5/dist-packages/mysql_connector_python_rf-2.2.2.dist-info'
How can a correct this problem?
Or How can I do a correct fresh install of my python2 and python3 environment on my Ubuntu 16.04 x86 Linux?
There is nothing wrong with your installation. To install packages globally, you need superuser privileges; you would run that command under sudo.
However, you should avoid doing this. Create a virtualenv and install the package there.

Permission denied error in pip installing pyopenssl

As I'm trying to force reinstall pyopenssl, I'm running into the following error when it tries to install pycparser. I am doing this on Windows 7 64-bit with Python 2.7 using the following command:
pip install pyopenssl --ignore-installed
Here is the traceback:
Exception:
Traceback (most recent call last):
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "C:\Python27\ArcGIS10.4\lib\site-packages\pip-8.1.2-py2.7.egg\pip\wheel.py", line 324, in clobber
shutil.copyfile(srcfile, destfile)
File "C:\Python27\ArcGIS10.4\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'C:\\Python27\\ArcGIS10.4\\Lib\\site-packages\\_cffi_backend.pyd'
Here is what I have noticed:
It only happens with _cffi_backend.pyd - other packages install and
uninstall fine.
I can pip uninstall cffi and re-install it alright, but whenever it
is present, the _cffi_backend.pyd permission error presents. This means that any installations calling cffi (for example pyopenssl) will fail.
Here is what I've tried:
Uninstalling and reinstalling cffi: no effect
Successfully used icalcs to set _cffi_backend.pyd to full access, everyone: no effect
Calling pip with python -m pip install pyopenssl --ignore-installed: no effect
Closed all applications and examined running processes before
installing: no effect
Reboot. Voodoo for the most part, but just to be thorough: no effect

pip install jupyter: "Unable to locate finder for 'pip._vendor.distlib'"

I'm trying to install jupyter to use the IPython Notebook under Windows. However, if I run pip install jupyter I'm getting
Using cached pyzmq-15.4.0.zip
Requirement already satisfied (use --upgrade to upgrade): wcwidth in c:\users\stefan\appdata\local\programs\python\python36\lib\site-packages (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
Installing collected packages: nbformat, nbconvert, pyzmq, jupyter-client, tornado, ipykernel, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter
Exception:
Traceback (most recent call last):
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\commands\install.py", line 317, in run
prefix=options.prefix_path,
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_set.py", line 742, in install
**kwargs
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\req\req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\wheel.py", line 493, in move_wheel_files
maker.make_multiple(['%s = %s' % kv for kv in console.items()])
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 383, in make_multiple
filenames.extend(self.make(specification, options))
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 372, in make
self._make_script(entry, filenames, options=options)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 276, in _make_script
self._write_script(scriptnames, shebang, script, filenames, ext)
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 212, in _write_script
launcher = self._get_launcher('t')
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\scripts.py", line 351, in _get_launcher
result = finder(distlib_package).find(name).bytes
File "C:\Users\Stefan\AppData\Local\Programs\Python\Python36\lib\site-packages\pip\_vendor\distlib\resources.py", line 324, in finder
raise DistlibException('Unable to locate finder for %r' % package)
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
Any idea what the problem here is?
uninstall current pip by typing:
python -m pip uninstall pip setuptools
download get-pip.py from https://bootstrap.pypa.io/get-pip.py and run it:
python get-pip.py
Try uninstalling pip and installing get-pip.py. It appears to be a bug in the 3.6 version for Windows. https://github.com/pypa/pip/issues/3964

Python: permission denied error when installing pip

I am a student and I am doing project on department computer, system Linux 7.2. Now I am trying to install pip so that I can install python packages using it.
I have downloaded get-pip.py and tried to install via python get-pip.py. It gives me:
Collecting pip
Downloading pip-8.1.1-py2.py3-none-any.whl (1.2MB)
100% |████████████████████████████████| 1.2MB 471kB/s
Collecting wheel
Downloading wheel-0.29.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 71kB 764kB/s
Installing collected packages: pip, wheel
Exception:
Traceback (most recent call last):
File "/tmp/tmpqybTwL/pip.zip/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/tmp/tmpqybTwL/pip.zip/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/tmp/tmpqybTwL/pip.zip/pip/req/req_set.py", line 732, in install
**kwargs
File "/tmp/tmpqybTwL/pip.zip/pip/req/req_install.py", line 835, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/tmp/tmpqybTwL/pip.zip/pip/req/req_install.py", line 1030, in move_wheel_files
isolated=self.isolated,
File "/tmp/tmpqybTwL/pip.zip/pip/wheel.py", line 344, in move_wheel_files
clobber(source, lib_dir, True)
File "/tmp/tmpqybTwL/pip.zip/pip/wheel.py", line 315, in clobber
ensure_dir(destdir)
File "/tmp/tmpqybTwL/pip.zip/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib64/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/pip'
Then, I tried to install using sudo python get-pip.py, however, I got "xxx is not in the sudoers file. This incident will be reported."
So, I was wondering whether I don't have the permission to root and don't have the right to do sudo...but I am not sure about this...
Any suggestion to fix this problem? And in the end, I want to install scipy and gensim.
Does the system hand you a virtualenv command?
Then you should read about virtualenvs. Comes in handy anyhow.
If not you may use the approach by Jasper van den Bosch
You either need to use a virtual environement, and install the pip package in the virtual env. Or install it with pip globally ie system wide as root user
Try install pip using easy_install
Try Below commands in terminal:
sudo su
easy_install pip

Categories

Resources