Access denied message when tried to install python module - python

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.

Related

Compiler problem installing cx_Oracle using pip on Solaris

I'm new to this stuff and any help would be awesome. I'm installing this through putty on an onprem server.
Collecting cx_Oracle==7.3
Downloading https://files.pythonhosted.org/packages/5e/e3/cfd4f413f8d47dd2aee09273d9bb3ee6aa7384e0a04e191d703c2199eb93/cx_Oracle-7.3.0.tar.gz (307kB)
100% |################################| 317kB 7.6MB/s
Installing collected packages: cx-Oracle
Running setup.py install for cx-Oracle ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-YAwTvN/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-nqdlEI/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
running build
running build_ext
building 'cx_Oracle' extension
creating build
creating build/temp.solaris-2.11-sun4v.32bit-2.7
creating build/temp.solaris-2.11-sun4v.32bit-2.7/src
creating build/temp.solaris-2.11-sun4v.32bit-2.7/odpi
creating build/temp.solaris-2.11-sun4v.32bit-2.7/odpi/src
cc -DNDEBUG -KPIC -DPIC -DCXO_BUILD_VERSION=7.3.0 -Iodpi/include -Iodpi/src -I/usr/include/python2.7 -c src/cxoBuffer.c -o build/temp.solaris-2.11-sun4v.32bit-2.7/src/cxoBuffer.o
unable to execute 'cc': No such file or directory
error: command 'cc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-YAwTvN/cx-Oracle/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-nqdlEI/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-YAwTvN/cx-Oracle/
Previously I was able to install awscli without any issues.
I'm not sure why is this happening.

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.

"pip install" permission denied on Mac

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

How can I install pymavlink to Raspberry?

I wrote this command to install:
sudo pip install pymavlink
and got this error:
ImportError: No module named future
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-gsZblL/pymavlink/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ppCGHA-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-gsZblL/pymavlink
Storing debug log for failure in /root/.pip/pip.log
I have solved the problem installing this package:
$ sudo pip install dronekit

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

Categories