I need to install https://pypi.python.org/pypi/PasteScript on a VM without sudo access (this one, if relevant). I've downloaded it but when I run python setup.py install I get:
running install Checking .pth file support in
/usr/local/lib/python2.7/dist-packages/ error: can't create or remove
files in install directory
The following error occurred while trying to add or remove files in
the installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-1621.pth'
The installation directory you specified (via --install-dir, --prefix,
or the distutils default setting) was:
/usr/local/lib/python2.7/dist-packages/
Perhaps your account does not have write access to this directory? If
the installation directory is a system-owned directory, you may need
to sign in as the administrator or "root" account.
One alternative suggestion I found was to use pip, but I can't install pip without sudo.
PS: There are many similar questions, but none (that I can find!
What about:
python setup.py install --user
As stated in the doc, it should work as you expect: https://docs.python.org/2/install/#alternate-installation-the-user-scheme
Related
I've downloaded python 3.6.1 and I'm trying to use terminal to setup beautifulsoup4 but it keeps trying to install on python 2.7. Any help?
Jakes-iMac:beautifulsoup4-4.5.3 Jake$ cd /Users/Jake/Downloads/beautifulsoup4-4.5.3
Jakes-iMac:beautifulsoup4-4.5.3 Jake$ python setup.py install
running install
Checking .pth file support in /Library/Python/2.7/site-packages/
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-18954.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://pythonhosted.org/setuptools/easy_install.html
Please make the appropriate changes for your system and try again
Running the "python" command in your terminal will by default run Python 2 on many systems, even after you have installed Python 3. Try using the "python3" command instead.
try this:
sudo python setup.py install
I am trying to install BeautifulSoup on my macOS. While installing i m getting below.
And also I tried with python setup.py install, but getting same error
Please help me to resolve this
bash-3.2$ easy_install /Users/SJV/Downloads/beautifulsoup4-4.4.1/beautifulsoup4.egg-info
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-620.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/Library/Python/2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://pythonhosted.org/setuptools/easy_install.html
Please make the appropriate changes for your system and try again.
Are you using root? Try:
sudo pip install beautifulsoup4 # will ask your sudo password
Or login as root before run pip install beautifulsoup4.
Also, install it in virtualenv or this way can without root permission(if you don't have root permission).
I have installed a private copy of Python 3.3.3 on Ubuntu 13.10 in a directory under my home directory. I then use the following command to try and install setuptools into my private copy with the results shown below.
jonathan#Hades:~/Downloads/Python/setuptools$ ../Python-3.3.3/python ez_setup.py
Extracting in /tmp/tmpyx2c9o
Now working in /tmp/tmpyx2c9o/setuptools-1.4
Installing Setuptools
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 2] No such file or directory: '/usr/lib/python3.3/site-packages/test-easy-install-6699.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.3/site-packages/
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
Something went wrong during the installation.
See the error message above.
I also tried the --user option which allowed the install to complete but put the contents under my ~/.locals directory, and not where I expected in the site-packages directory of my private Python installation.
I had thought that my private copy of Python would take care of finding the right site-packages directory but obviously this did not happen. What do I need to do to get a successful installation?
I want to install Sphinx 1.1.3 for python 2.6. However, I don't have sudo rights. So instead of installing it in the default place, I want to set a different location, using --prefix. Doing the following:
-bash-3.2$ easy_install Sphinx-1.1.3-py2.6.egg --prefix=/homes/ndeklein/python2.6/site-packages/
gives me:
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python2.4/site-packages/test-easy-install-18534.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python2.4/site-packages/
Am I typing something wrong with the prefix? Also, what I could use instead (which I've used with other packages):
python setup.py install --home=/homes/ndeklein/python2.6/site-packages/
but I can't find the setup.py script. I'm guessing that EGGs don't have a setup.py script, is that true?
You need to specify options before the package, so the command should be:
easy_install --prefix=/homes/ndeklein/python2.6/site-packages/ Sphinx-1.1.3-py2.6.egg
This website discusses non-root python installs. It might be useful to you...
http://www.astropython.org/tutorials/user-rootsudo-free-installation-of-python-modules7/
To quote a little bit of it:
A user configuration file, ~/.pydistutils.cfg, will override the internal system path for python package installations, redirecting the built libraries (lib), scripts (bin) and data (share) into user owned and specified directories. You must simply tell the python installer where theses directories are located.
The user file, ~/.pydistutils.cfg, has the following lines, using a pretty obvious syntax:
[install]
install_scripts = ~/usr/bin
install_data = ~/usr/share
install_lib = ~/usr/lib/python2.4/site-packages
Of course, whatever directories you specify there should probably exist and you should put them at the front of your PYTHONPATH:
export PYTHONPATH=~/usr/lib/python2.4/site-packages:${PYTHONPATH}
It also looks like more modern python installations (compared to the things in the link) should be able to use the ~/.local directory:
easy_install --prefix=~/.local ...
There is also:
easy_install --user ...
which will install to a user-specific site directory.
You could try using pip install of easy_install(pip is recommended over easy_install these days)
Then you can just use
pip install --user Sphinx
see http://www.pip-installer.org/en/latest/installing.html on how to install pip if needed
You may also want to pip install virtualenv and work inside virtualenv(where pip will install all packages in a local site packages folder). see http://pypi.python.org/pypi/virtualenv for more info.
I am trying to use easy_install to install a module called requests by doing
easy_install requests
This worked fine a week ago when I was using Python 2.6.5 but today I installed Python 2.7.2 and then tried to import requests in one of my scripts but it failed. I then tried reinstalling requests with easy_install requests but got this error
install_dir /usr/local/lib/python2.6/dist-packages/
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.6/dist-packages/test-easy-install-15207.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.6/dist-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://packages.python.org/distribute/easy_install.html
Please make the appropriate changes for your system and try again.
So I was told to go reinstall easy_install and I went to http://pypi.python.org/pypi/setuptools and learned I had to
delete all setuptools*.egg and setuptools.pth files from your
system's site-packages directory (and any other sys.path directories)
FIRST.
So I did this. I then reinstalled setuptools from the setuptools-0.6c11-py2.7.egg. It seemed successful but when I ran easy_install requests I got basically the same error except the directory python2.6/dist-packages is now python2.7/site-packages
siddhion#siddhion-laptop:~$ easy_install requests
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/test-easy-install-16253.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.7/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
http://peak.telecommunity.com/EasyInstall.html
Please make the appropriate changes for your system and try again.
Also, when I do easy_install and press tab I get these options
easy_install easy_install-2.6 easy_install-2.7
How come easy_install-2.6 is there?
and
How do I get easy-install working again?
Did you try using sudo like this?
sudo easy_install requests
Or specify the install directory to a directory that you have write privileges.
easy_install --install-dir=/home/foo/bar
But you should really use PIP instead of easy_install. It is much better and has a lot more features.
You should use virtualenv on package-based Linux distributions so Python scripts don't interfere with other packages or conflict with the OS's package-manager.
http://workaround.org/easy-install-debian
The following worked for me with Ubuntu 12.10 installing easy_install then pip:
sudo apt-get install python-virtualenv
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
sudo python get-pip.py
Have you tried adding your new python.framework to path?
On mountain lion I added
/Library/Frameworks/Python.framework/Versions/3.3/bin/
to
/etc/paths
and then I was able to use easy_install-3.3 and pip-3.3
Using Sudo before easy_install may solve your problem
Sudo easy_install requests
thanks
It might be a simple case of you missing "sudo" in the front. Can you try it with sudo easy-install requests
putting the "sudo" will add the required permissions.