I am trying to setup my Python environment in cloud Linux. I copied the working folder "Artem's_strategy", which contains the source code setup.py, from local PC to the cloud LInux system. When trying to install setup.py I get the following error
[ec2-user@ip-xxx Artem's_strategy]$ python3 setup.py install
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/local/lib/python3.7/site-packages/test-easy-install-2160.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python3.7/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).
In other thread I found solution in the form of using --install-dir, which brings following error:
[ec2-user@ip-xxx~]$ /home/ec2-user/Artem\'s_strategy/setup.py --install-dir=/usr/local/lib/python3.7/site-packages
: No such file or directory
Checking the folder we can see that setup.py exists in this folder:
[ec2-user@ip-xxx Artem's_strategy]$ ls -la
total 1480
-rwxr-xr-x 1 ec2-user ec2-user 354 Mar 17 15:51 setup.py
So your help with installing from source code setup.py would be appreciated.
You should try this:
python setup.py install --user || exit 1
source: https://github.com/hughperkins/pytorch/issues/8
If you go into a terminal and execute:
python3 -m site
It should give you a response similar to the following:
sys.path = [
'/home/tyler',
'/usr/lib/python36.zip',
'/usr/lib/python3.6',
'/usr/lib/python3.6/lib-dynload',
'/home/tyler/.local/lib/python3.6/site-packages',
'/usr/local/lib/python3.6/dist-packages',
'/usr/lib/python3/dist-packages',
]
USER_BASE: '/home/tyler/.local' (exists)
USER_SITE: '/home/tyler/.local/lib/python3.6/site-packages' (exists)
ENABLE_USER_SITE: True
Using this, you can determine the directory in which your site-packages are stored and use the
--install-dir
parameter to install it there. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With