I am trying to run a python script that calls the yaml module on a server. I only have writing permissions in my home directory. The server has Python 2.7.3 installed. I do not have root access. Also, neither pip nor easy_install are available.
I have downloaded the package and tried to run
python setup.py install --user
which gives the error
error: can't combine user with with prefix/exec_prefix/home or install_(plat)base
How can I get this to work?
Based on the idea of the answer by Anton, these steps worked for me
then replace in your script
with:
Setting up and using a virtualenv is almost always a good option and as you indicated you can download virtualenv.py, but that won't run (anymore) without
pip
being installed because it tries to install wheels. On Linux Mint with Python 2.7.6 the script e.g. throws:You can probably circumvent that by using an older
virtualenv.py
.In some other cases it is not feasible to use a virtualenv: e.g. when the system python has all kinds of libraries pre-installed that you need to use and cannot replicate into a local virtualenv. In that case you can download the latest version of ruamel.yaml (of which I am the author) and which is essentially a superset of the PyYAML functionality. When I forked the code I created a setup.py from scratch and it allows you to do
without problem on the `setup.py extracted from the tar.gz file downloaded from PyPI.