Install setuptools 1.4 into private copy of Python 3.3.3 - python

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?

Related

How to install downloaded Python packages without sudo?

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

Errno 13 Permission denied: '/Library/Python/2.7/site-packages/test-easy-install-18954.pth'

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

Problems installing django

I'm trying to install django by acessing the directory that contains setup.py using
cd [Path to Django] and then python setup.py install. But the following is shown on terminal:
running install
Checking .pth file support in /usr/local/lib/python3.4/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/python3.4/dist-packages>/test-easy-install-5264.pth'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python3.4/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:
https://pythonhosted.org/setuptools/easy_install.html
Please make the appropriate changes for your system and try again.
I am new to using Ubuntu and Python, so i am a little lost. Can someone help?
I am using Ubuntu 14.04.

Received an error message when installing Beautiful Soup4 on Mac

I am using a Mac and I get an error message on my terminal when I try to install Beautiful Soup. I have Python 3 installed already.
This is what I did after unpacking the Beautiful Soup zip file
$ cd Users/thepredestrian/Desktop/beautifulsoup4-4.4.1
$ python setup.py install
This is the error message that appears:
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-966.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
Any advice appreciated!
Try installing with sudo.
sudo python setup.py install
An alternate way is to use virtual environment. Inside a virtual environment, you can install dependencies locally rather than system wide, so you won't need access to a root account.
pip install virtualenv
virtualenv test
cd test
source bin/activate
The first line installs virtualenv. The second line creates a virtual environment. The third and fourth line activates (starts) the virtualenv. You will notice the change in prompt. Inside virtualenv, you can install dependencies (e.g BeautifulSoup), run python scripts and so on. Once you're done, you can deactivate the environment by simply typing deactivate in the shell.

Easy_install's --prefix option doesn't change where it tries to install my package

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.

Categories

Resources