pip linked to python3.6

Asked by chang tien ho

Hello,

while trying to run Madgraph3.2 with python 3.8.11, it claims that I haven't installed the six file:

madgraph requires the six module. The easiest way to install it is to run "pip3 install six --user"
in case of problem with pip, you can download the file at https://pypi.org/project/six/ . It has a single python file that you just need to put inside a directory of your $PYTHONPATH environment variable.

when I tried to run the suggested command "pip3 install six --user"
it shows:

Requirement already satisfied: six in /usr/lib/python3.6/site-packages

I found a similar post here in https://answers.launchpad.net/mg5amcnlo/+question/698479,
where moving the six.py seemed to be the key, but the path '/usr/lib/python3.6/site-packages' seems to deny me moving the six.py file,

[tichang@lxplus768 site-packages]$ mv six.py ~
mv: cannot remove 'six.py': Permission denied

I tried to move again by using sudo, but another error occured:

[tichang@lxplus768 site-packages]$ sudo mv six.py ~
bash: sudo: command not found
[tichang@lxplus768 site-packages]$ sudo
bash: sudo: command not found

how can I solve this? Thanks in advance!

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
chang tien ho
Solved:
Last query:
Last reply:
Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#1

hi,

I have two idea:
1) pip3.8 should likely do the trick
2) "cp" should not create a permissions denied

Cheers,

Olivier

Revision history for this message
chang tien ho (tichang) said :
#2

Thanks for your answer:

I managed to copy the six.py file to my Mafgraph file but was still unable to run Madgraph successfully (running into the same errors as before)
I managed to solve my problem by using virtual environment (env), where I was able to upgrade my pip3 to version 3.8 and run Madgraph successfully.
It seems that pip3.8 was not originally installed in the system.
also pip3 points to 3.6 in the root files.

Thank you!

Revision history for this message
Gregory M. Williams (regory234) said :
#3

If you want to use a different version of Python with "pip", you will need to make sure that "pip" is linked to the correct version of Python. You can do this by either reinstalling "pip" while using the desired version of Python, or by using a virtual environment to isolate your Python environment and manage your packages. https://cncrouterhub.com/best-cnc-router/