Install.sh for pip install


#1

Hi,

Can anybody show me an install.sh file that works for installing python packages?
The suggestion in the README

#!/bin/bash
python3.6 -m pip install --sytem --target . numpy
python3.6 -m pip install --sytem --target . scipy
python3.6 -m pip install --sytem --target . networkx

gives the error

End of install.sh stdout. stderr as follows:
Usage:   
  /usr/bin/python3.6 -m pip install [options] <requirement specifier> [package-index-options] ...
  /usr/bin/python3.6 -m pip install [options] -r <requirements file> [package-index-options] ...
  /usr/bin/python3.6 -m pip install [options] [-e] <vcs project url> ...
  /usr/bin/python3.6 -m pip install [options] [-e] <local project path> ...
  /usr/bin/python3.6 -m pip install [options] <archive url/path> ...

no such option: --system 

and the the example on The Halite III Server Environment also gives an error.
What is the command that does work?


#2

Try removing --system and see what happens.

no such option: --system


#3

That is the example on


and also gives an error

Error chmoding ./decorator.py - [Errno 1] Operation not permitted: './decorator.py'

Error chmoding ./share/doc/networkx-2.2/examples/graph/plot_roget.py - [Errno 1] Operation not permitted: './share/doc/networkx-2.2/examples/graph/plot_roget.py'

Error chmoding ./share/doc/networkx-2.2/examples/graph/plot_football.py - [Errno 1] Operation not permitted: './share/doc/networkx-2.2/examples/graph/plot_football.py'

Error chmoding ./share/doc/networkx-2.2/examples/graph/plot_erdos_renyi.py - [Errno 1] Operation not permitted: './share/doc/networkx-2.2/examples/graph/plot_erdos_renyi.py'

Error chmoding ./share/doc/networkx-2.2/examples/graph/expected_degree_sequence.py - [Errno 1] Operation not permitted: './share/doc/networkx-2.2/examples/graph/expected_degree_sequence.py'

#4

try replacing --system with --user or --system-site-packages


#5

For --system-site-packages I get the same error as for --system : no such option: --system-site-packages

and for the --user option I get the following error
Exception: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/pip/_internal/cli/base_command.py", line 143, in main status = self.run(options, args) File "/usr/local/lib/python3.6/dist-packages/pip/_internal/commands/install.py", line 366, in run use_user_site=options.use_user_site, File "/usr/local/lib/python3.6/dist-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs **kwargs File "/usr/local/lib/python3.6/dist-packages/pip/_internal/req/req_install.py", line 760, in install use_user_site=use_user_site, pycompile=pycompile, File "/usr/local/lib/python3.6/dist-packages/pip/_internal/req/req_install.py", line 382, in move_wheel_files warn_script_location=warn_script_location, File "/usr/local/lib/python3.6/dist-packages/pip/_internal/wheel.py", line 215, in move_wheel_files prefix=prefix, File "/usr/local/lib/python3.6/dist-packages/pip/_internal/locations.py", line 165, in distutils_scheme i.finalize_options() File "/usr/lib/python3.6/distutils/command/install.py", line 274, in finalize_options raise DistutilsOptionError("can't combine user with prefix, " distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base


#6

Btw, just found out that scipy and numpy are already installed. So, basically the question is, how do I get networkx to work?


#7

maybe try conda instead nevermind, I tried it doesn’t work even though server environment says conda is installed

#!bin/bash

conda install networkx


#8

Nope…
Possible errors running install.sh. stdout output as follows: End of install.sh stdout. stderr as follows: ./install.sh: line 2: conda: command not found End of install.sh output.


#9

I just tried

#bin/bash

python3.6 -m pip install --target . networkx

and it worked for me.


#10

What the ****, I thought I tried that a lot of times already.
No idea what happened there, but it works now, thanks for the help!!


#11

Have the same issue with scikit-image.
install.sh

#!/bin/sh
python3.6 -m pip install --target . scikit-image==0.14.*

Log:

Possible errors running install.sh. stdout output as follows:
Collecting scikit-image==0.14.*
... usual pip output ...
Successfully installed PyWavelets-1.0.1 cloudpickle-0.6.1 cycler-0.10.0 dask-0.20.1 decorator-4.3.0 kiwisolver-1.0.1 matplotlib-3.0.2 networkx-2.2 numpy-1.15.4 pillow-5.3.0 pyparsing-2.3.0 python-dateutil-2.7.5 scikit-image-0.14.1 scipy-1.1.0 setuptools-40.5.0 six-1.11.0 toolz-0.9.0
End of install.sh stdout. stderr as follows:
tensorflow 1.11.0 has requirement setuptools<=39.1.0, but you'll have setuptools 40.5.0 which is incompatible.
End of install.sh output.
Error chmoding ./pyparsing.py - [Errno 1] Operation not permitted: './pyparsing.py'
...

Maybe there is something with reinstalling already preinstalled packages. The only solution atm I think is to list all dependencies manually (skipping already installed at server) and add --no-deps flag. But The Halite III Server Environment does not listed all packages (no setuptools, six, etc) so it is pretty hard to debug.


#12

Any output on stderr is treated as a ‘failure’ - you can suppress this by redirecting stderr.

python3.6 -m pip install --target . scikit-image==0.14.* 2>/dev/null

#13
Possible errors running install.sh. stdout output as follows:
End of install.sh stdout. stderr as follows:
./install.sh: line 2: /dev/null
: Permission denied
End of install.sh output.

did not know that you can set permssions for /dev/null :roll_eyes:

update:
Ok, this works but requires manually check dependencies.

python3.6 -m pip install --no-deps --target . scikit-image pywt