Python Forum
Call pip3 from python folder build by me call pip3 from the /usr/bin - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Call pip3 from python folder build by me call pip3 from the /usr/bin (/thread-21472.html)



Call pip3 from python folder build by me call pip3 from the /usr/bin - Suryavarman - Oct-01-2019

I have build the latest release of python3 on a Mageia7 system.
Here the configuration command line:
./configure --prefix=${PY_PATH} --enable-shared

And if I call pip3 like that:

${PY_PATH}/bin/pip3 …
${PY_PATH}/bin/python3 pip3 …
${PY_PATH}/bin/python3 ${VENV_PATH}/bin/pip3 …
${PY_PATH}/bin/python3.7 ${VENV_PATH}/bin/pip3.7 …
${PY_PATH}/bin/python3.7m ${VENV_PATH}/bin/pip3.7 …

All this command lines have the same result.
An output example:
Output:
Requirement already satisfied, skipping upgrade: apipkg>=1.4 in /usr/local/lib/python3.7/site-packages (from execnet>=1.1->pytest-xdist) (1.5)
Or :
Error:
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission non accordée: '/usr/local/bin/f2py' Consider using the `--user` option or check the permissions.
Why ${PY_PATH}/bin/python3 ${VENV_PATH}/bin/pip3 call the pip3 system from /usr/bin?

(Please don't ask me to use a venv, virtualenv or anaconda or wathever... I hate the hasardous behaviour of this things. Angry)

Response: don't build python with the shared option.


It's works. I don't khow why.


RE: Call pip3 from python folder build by me call pip3 from the /usr/bin - Axel_Erfurt - Oct-01-2019

The problem is not from where pip starts, you do not have write permission for /usr/local/lib/python3.7/site-packages as a user.

So you have to use sudo or 'pip install --user packagename'


RE: Call pip3 from python folder build by me call pip3 from the /usr/bin - Suryavarman - Oct-01-2019

Hi,

I haven't build and install python in the files system but in a /home/username/Python folder.
The building otpion --enable-shared cause this error. Without this option it's work.


RE: Call pip3 from python folder build by me call pip3 from the /usr/bin - Suryavarman - Oct-07-2019

If you need to activate the --enable-shared the answer is:
./configure --prefix=${PY_PATH} --enable-shared LDFLAGS=-Wl,-rpath=${PY_PATH}/lib --enable-optimizations # --enable-optimizations is optional
make -j 16
make altinstall
If you have this error:
./python: symbol lookup error: ./python: undefined symbol: __gcov_indirect_call
Delete ${PY_PATH} folder befor to call configure.

Links:
https://bugs.python.org/issue29712
https://stackoverflow.com/questions/38772946/what-exactly-does-configure-enable-shared-do-during-python-altinstall

To use waf i need do define some symbolic link:
ln -sf ${PY_PATH}/bin/python3.7m ${PY_PATH}/bin/python3
ln -sf ${PY_PATH}/bin/pip3.7 ${PY_PATH}/bin/pip3
ln -sf ${PY_PATH}/bin/pip3.7 ${PY_PATH}/bin/pip
ln -sf ${PY_PATH}/bin/python3.7m-config ${PY_PATH}/python3.7-config
ln -sf ${PY_PATH}/bin/python3.7m-config ${PY_PATH}/bin/python3-config