Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save magks/853c5474c77fe2918901887508ead0de to your computer and use it in GitHub Desktop.
Save magks/853c5474c77fe2918901887508ead0de to your computer and use it in GitHub Desktop.
Local install without sudo python3-devel
wget https://www.python.org/ftp/python/3.4.5/Python-3.4.5.tgz
tar -zxvf Python-3.4.5.tgz
cd Python-3.4.5/
./configure --with-pydebug --prefix=/home/<USERNAME>/<LOCALPROGRAMDIR>
make altinstall -s -j<CPU_CORES--CHECK_WITH_NPROC_TO_SEE_HOW_MANY_YOU_HAVE>
ln -s /home/USERNAME/<LOCALPROGRAMDIR>/python3.4 /home/USERNAME/<LOCALPROGRAMDIR>/python3
# DONE -- make sure your path looks in /home/<USERNAME>/<LOCALPROGRAMDIR> first
# e.g. echo "export PATH=/home/<USERNAME>/<LOCALPROGRAMDIR>:$PATH" >> ~/bash_profile
# followed by source ~/bash_profile
@sohang3112
Copy link

sohang3112 commented Feb 6, 2023

Thanks for sharing these instructions in a public gist! 🙂

I installed Python 3.7.16 in my home using these commands. But trying to install psutil fails with an error:

$ /home/USERNAME/<LOCALPROGRAMDIR>/python3.7 -m pip install psutil
   ...
ModuleNotFoundError: No module named '_ctypes'

Some online sources suggest doing yum install libffi-devel - but I don't have sudo access. Do you have any idea how to solve this problem without sudo access?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment