0

I am using a server with Python 3.4. I need to use Python 3.6.4 with some packages. I therefore created an environment with conda using

conda create --name myname python=3.6.4
conda install --name myname --file spec-file.txt

where spec-file.txt was created from a conda on another machine in order to clone that enviroment.

However, when I try to run my script, it seems I don't have the permission to access them.

(myname) [myname@myserver my_folder]$ python myscript.py -img_lst_fp /home/myname/my_folder/myserver_pictures.csv -out_fl /home/myname/my_folder/output.csv
bash: /home/myname/.conda/envs/myname/bin/python: cannot execute binary file

(myname) [myname@myserver my_folder]$ python
bash: /home/myname/.conda/envs/myname/bin/python: cannot execute binary file
(myname) [myname@myserver my_folder]$ ./myscript.py -img_lst_fp /home/myname/my_folder/myserver_pictures.csv -out_fl /home/myname/my_folder/output.csv
bash: ./myscript.py: Permission denied

Is there a way to solve this without requesting the intervention of a root user?

EDIT: I have no idea why but now I cannot even execute "python"

nekomatic
  • 5,988
  • 1
  • 20
  • 27
user1315621
  • 3,044
  • 9
  • 42
  • 86
  • 2
    Seems like `./myscript.py` doesn't have the execute bit set. You can chmod it or do `python ./myscript.py`. – Håken Lid Feb 24 '18 at 20:28
  • 1
    It might also be something wrong with the python binary. Are you sure it is built for the same architecture? https://superuser.com/a/436081 – Håken Lid Feb 24 '18 at 20:31
  • Edit before: I cannot even execute python. – user1315621 Feb 24 '18 at 20:36
  • 2
    It could be that the other machine where you built the spec has a different architecture. _Conda does not check architecture or dependencies when installing from a spec file. To ensure that the packages work correctly, make sure that the file was created from a working environment, and use it on the same architecture, operating system and platform, such as linux-64 or osx-64._ https://conda.io/docs/user-guide/tasks/manage-environments.html#building-identical-conda-environments – Håken Lid Feb 24 '18 at 20:36
  • 2
    [How to share conda environments across platforms](https://stackoverflow.com/questions/39280638/how-to-share-conda-environments-across-platforms) – Håken Lid Feb 24 '18 at 20:39
  • To check that the platform of the two machines are the same you can use the command `uname -oi`. – Håken Lid Feb 24 '18 at 20:48

1 Answers1

-1

Try this:

pip install --user virtualenv
rahul mehra
  • 418
  • 2
  • 13