"pip install" permission denied on Mac - python

I tried to install the base65536 module, by typing this into Terminal:
pip install base65536
Yet it produced this error:
Collecting base65536
Using cached base65536-0.1.1.tar.gz
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from base65536)
Installing collected packages: base65536
Running setup.py install for base65536 ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-build-tl_DyR/base65536/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-ZZqmm6-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/base65536
copying base65536/about.py -> build/lib/base65536
copying base65536/init.py -> build/lib/base65536
copying base65536/core.py -> build/lib/base65536
running install_lib
creating /Library/Python/2.7/site-packages/base65536
error: could not create '/Library/Python/2.7/site-packages/base65536': Permission denied
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-build-tl_DyR/base65536/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-ZZqmm6-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/2h/n5zk2_w50273k4hdxw8l05240000gn/T/pip-build-tl_DyR/base65536/
How can I fix this?

Thats because you dont have admin permissions.
try this
sudo pip install base65536

When it says Permission Denied that means that you are not an administrator on your computer and therefore cannot do this. Try running as administrator. If you are using windows, right click on app and select 'Run as Administrator'. If you are using mac, and you are not the administrator on your computer, type su (Whatever the name of the admin. user is)
For example, su adminUsername
Then type
pip install base65536

Related

Error During Installation of Darknet on Windows

I couldn't find any good tutorial for installation of Darknet and Lightnet on Windows. However, following the tutorials on their official Git Page, I tried running Python command
pip install darknetpy
On running this, I am seeing the following error:
Failed building wheel for darknetpy
Running setup.py clean for darknetpy
Failed to build darknetpy
Installing collected packages: darknetpy
Running setup.py install for darknetpy ... error
Complete output from command c:\users\pop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Pop\\AppData\\Local\\Temp\\pip-build-aew1mvz2\\darknetpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Pop\AppData\Local\Temp\pip-hj4a3ywj-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
'make' is not recognized as an internal or external command,
operable program or batch file.
error: [WinError 2] The system cannot find the file specified: 'C:\\Users\\Pop\\AppData\\Local\\Temp\\darknet\\libdarknet.so'
----------------------------------------
Command "c:\users\pop\appdata\local\programs\python\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Pop\\AppData\\Local\\Temp\\pip-build-aew1mvz2\\darknetpy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\Pop\AppData\Local\Temp\pip-hj4a3ywj-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Pop\AppData\Local\Temp\pip-build-aew1mvz2\darknetpy\
Even with Cygwin(64), the issue darknetpy issue 1 shows it wouldn't work on Windows.
The best options are (on Windows):
use a VM Linux
use a docker image for darknet, like lindt/docker-darknet (with docker-for-windows, which will use a small Linux VM through HyperV)
The pypi page for darketpy indicates that it requires a POSIX operating system. If you want to install it on Windows, you'll need something like cygwin.

Error installing Pillow (Django)

I'm having trouble getting Pillow to install.
Here's the full traceback:
Collecting Pillow
Using cached Pillow-4.0.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting olefile (from Pillow)
Using cached olefile-0.44.zip
Installing collected packages: olefile, Pillow
Running setup.py install for olefile ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-QHsEXV-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib
copying OleFileIO_PL.py -> build/lib
creating build/lib/olefile
copying olefile/__init__.py -> build/lib/olefile
copying olefile/olefile.py -> build/lib/olefile
copying olefile/README.rst -> build/lib/olefile
copying olefile/README.html -> build/lib/olefile
copying olefile/LICENSE.txt -> build/lib/olefile
copying olefile/CONTRIBUTORS.txt -> build/lib/olefile
running install_lib
creating /Library/Python/2.7/site-packages/olefile
error: could not create '/Library/Python/2.7/site-packages/olefile': Permission denied
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-QHsEXV-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/bt/_3d4816x12d95tzvcp_0302w0000gn/T/pip-build-UyBMYN/olefile/
The error seems to be 'Permission denied' when attempting to create the folder; though I cannot understand why...
My machine is running Mac OSX, and I'm using Terminal to run the commands for this Django project.
Because the normal user doesn't have permission to install packages globally. Either run with sudo, or - much better - use a virtualenv and install your packages in there.
There're several questions regarding this problem, I'd suggest to take a look at these:
Using virtualenv https://stackoverflow.com/a/19472082/394647
Using $HOMEhttps://stackoverflow.com/a/7143496/394647
I prefer the second one but it also depends on your project/app structure

Failed building wheel for mysqlclient

I downloaded wheel to the most recent version
But I'm not entirely sure how to make of this semi-cryptic error message
Failed building wheel for mysql-python
Command "/Users/username/Desktop/Project/venv/bin/python -u -c "import setuptools,
tokenize;__file__='/private/var/folders/bg/_nsyc_vxasdfx___h11f3jw00000gn/T/pip-build-rBf9R1/mysql-python/setup.py';
f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');
f.close();exec(compile(code, __file__, 'exec'))"
install --record /var/folders/bg/_nsyc_vx4g___xbsh11f3jw00000gn/T/pip-Tjwbij-record/install-record.txt --single-version-externally-managed
--compile --install-headers /Users/username/Desktop/project/venv/include/site/python2.7/mysql-python" failed with error code 1 in
/private/var/folders/bg/_nsyc_vxasdf__xbsh11f3jw00000gn/T/pip-build-rBf9R1/mysql-python/
I tried
pip install --upgrade wheel
and I get
Requirement already up-to-date: wheel
MySQL version
mysql Ver 14.14 Distrib 5.7.10, for osx10.11 (x86_64) using EditLine wrapper
As for me, it is because my system lack of python3 developing lib. It warns that there is no "Python.h" while installing. The following command fix it for me.
yum install python34-devel -y
pip3 install mysqlclient
The topic is quite old but for the people who might be suffered from having this problem,this can be your solution:
First of all,you must open the file where you use Python like 3.5,3.6,Anaconda etc. Then open cmd in that file and run the command below:
$ pip install mysqlclient==1.3.12

Error when installing awsebcli

I tried to install AWS EB CLI on Windows 10, but got an error.
Python version: 3.5
What I did:
python -m pip install awsebcli
What I got:
......
copying lib3\yaml\__init__.py -> build\lib.win-amd64-3.5\yaml
running build_ext
creating build\temp.win-amd64-3.5
creating build\temp.win-amd64-3.5\Release
checking if libyaml is compilable
error: [WinError 2] ═ The system cannot find the file specified
----------------------------------------
Command ""C:\Program Files\Python 3.5\python.exe" -c "import setuptools, tokenize;__file__='C:\\Users\\Maksim\\AppData\\Local\\Temp\\pip-build-dkbpajst\\pyyaml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Maksim\AppData\Local\Temp\pip-y0knjbc5-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Maksim\AppData\Local\Temp\pip-build-dkbpajst\pyyaml
What could be wrong?
According to the documentation: "The EB CLI is not compatible with Python 3.5.".
I'm on python Python 3.4.3 and it works just fine. It also works nicely with python 2.7.x

Access denied message when tried to install python module

When i tried installing oauth module in python using pip
pip install oauth
I get this error
Downloading/unpacking oauth
Downloading oauth-1.0.1.tar.gz
Running setup.py (path:/tmp/pip_build_mounarajan/oauth/setup.py) egg_info for package oauth
Installing collected packages: oauth
Running setup.py install for oauth
error: could not create '/usr/local/lib/python2.7/dist- packages/oauth': Permission denied
Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_mounarajan/oauth/setup.py';exec(compile( getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-N_OqTH-record/install- record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/oauth
copying oauth/__init__.py -> build/lib.linux-x86_64-2.7/oauth
copying oauth/oauth.py -> build/lib.linux-x86_64-2.7/oauth
running install_lib
creating /usr/local/lib/python2.7/dist-packages/oauth
error: could not create '/usr/local/lib/python2.7/dist- packages/oauth': Permission denied
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_mounarajan/oauth/setup.py';exec(compile( getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-N_OqTH-record/install- record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_mounarajan/oauth
Storing debug log for failure in /home/mounarajan/.pip/pip.log
How could i change the permissions for python directory?
Thid problem accours when i try to install any module using pip
You might want to use sudo for installing modules using pip.

Categories