0

I am having problems with installing a python package (pandas) on Ubuntu 18.04 to a specific Python (3.6.5) distribution in Salome_meca located in: /home/username/salome_meca/V2019.0.3_universal/prerequisites/Python-365/lib/python3.6/os.py

if I run: sudo python3.6 -m pip install --install-option="--prefix=/home/username/salome_meca/V2019.0.3_universal/prerequisites/Pandas-120" pandas

It raises an error: Requirement already satisfied: pandas in /usr/lib/python3/dist-packages

And I cannot import this module as the python (3.6.5) distribution in Salome_meca cannot find it, when I run the code in the Salome_meca invornment.

lskrinjar
  • 5,483
  • 7
  • 29
  • 54

2 Answers2

1

Try using the -t (target switch) as seen here

sudo python3.6 -m pip install -t =/home/username/salome_meca/V2019.0.3_universal/prerequisites/Pandas-120
BeeFriedman
  • 1,800
  • 1
  • 11
  • 29
  • Thanks, but returns: 'The directory '/home/sername/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/username/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. You must give at least one requirement to install (see "pip help install")' – lskrinjar Jan 04 '21 at 15:17
  • And if I add also H to the command: sudo -H python3.6 -m pip3 install pandas -t=/home/username/salome_meca/V2019.0.3_universal/prerequisites/Pandas-120 It does not install to the specified directory. Any ideas? – lskrinjar Jan 04 '21 at 16:25
  • 1
    Add write access for your current user to the directory – BeeFriedman Jan 04 '21 at 18:27
0

The problem was solved by firstly input in terminal ./salome shell and then pip3 install pandas and this installed pandas under the python distribution within salome_meca. The only problem is that it was not installed in the correct folder (but works anyway). Probably one should set also the target dir, and then the command should be: pip3 install pandas --target=/home/lskrinjar/salome_meca/V2019.0.3_universal/prerequisites/Pandas-115

lskrinjar
  • 5,483
  • 7
  • 29
  • 54