serve icon indicating copy to clipboard operation
serve copied to clipboard

Error installing

Open fbbradheintz opened this issue 6 years ago • 8 comments

Error during install while running tests:

    2019-12-16 13:55:36,353 [WARN ] W-9008-noop-stderr org.pytorch.serve.wlm.WorkerLifeCycle -     import psutil
    2019-12-16 13:55:36,353 [WARN ] W-9008-noop-stderr org.pytorch.serve.wlm.WorkerLifeCycle - ModuleNotFoundError: No module named 'psutil'

Looks like a Python dependency issue.

fbbradheintz avatar Dec 16 '19 22:12 fbbradheintz

conda install psutil did the trick, but I'm leaving this open because the installation and instructions need to be fixed.

fbbradheintz avatar Dec 16 '19 22:12 fbbradheintz

Updated the installation steps in the documentation to use "pip install" command instead of "python setup.py"

harshbafna avatar Dec 21 '19 11:12 harshbafna

@harshbafna Verified the pip install steps worked. Please see related issue #13 for MaOs

chauhang avatar Dec 29 '19 19:12 chauhang

Still failing for me - root issue was test failures where Java was throwing an exception because it couldn't open Python. (???) Retrying after psutil was installed again seemed to do the trick.

This is in a clean conda environment with Java 8, PyTorch 1.4, TorchVision 0.5 installed.

If no one else can repro, let me know and I'll provide full call stacks &c

fbbradheintz avatar Jan 28 '20 22:01 fbbradheintz

@fbbradheintz : we could not reproduce the above issue. Could you please try again on latest master. Please share the logs in case the issue persists.

harshbafna avatar Feb 07 '20 09:02 harshbafna

It happened again. pip install . fails on a bunch of tests. Repeating pip install . works. This suggests to me that there is a problem with the order dependencies are installed. The most interesting lines I saw in the log were:

      2020-02-12 13:11:53,568 [WARN ] W-9005-noop_1.11-stderr org.pytorch.serve.wlm.WorkerLifeCycle -     import psutil
      2020-02-12 13:11:53,568 [WARN ] W-9000-noop_1.11-stderr org.pytorch.serve.wlm.WorkerLifeCycle -     import psutil
      2020-02-12 13:11:53,568 [WARN ] W-9005-noop_1.11-stderr org.pytorch.serve.wlm.WorkerLifeCycle - ModuleNotFoundError: No module named 'psutil'
      2020-02-12 13:11:53,568 [WARN ] W-9000-noop_1.11-stderr org.pytorch.serve.wlm.WorkerLifeCycle - ModuleNotFoundError: No module named 'psutil'

To repro:

  • Create a pip or conda virtual environment without psutil installed (but with PyTorch & the other deps specified in the README)
  • Clone the TorchServe repo
  • cd serve
  • pip install .

I'll circle back to this and try to get more complete logs in a bit.

fbbradheintz avatar Feb 12 '20 21:02 fbbradheintz

env-before-install.txt pip-install-serve-output.txt pip-install-serve-errors.txt

Attached please find:

  • A file containing the starting config of my virtual environment prior to receiving the error from pip install .
  • A file containing output of pip install .
  • A file containing error output of pip install .

That should be plenty to repro.

fbbradheintz avatar Feb 12 '20 21:02 fbbradheintz

@fbbradheintz this issue is because of conda. Where while installing psutil, conda downloads “.tar.gz” from “https://files.pythonhosted.org”, instead of downloading the “.whl” file. Due to this setuptools builds the wheel for psutil locally in parallel to “torchserve”. However, torchserve expects all the python packages provided in “install_requires” parameter in setup.py file to be pre-installed.

This issue is not observed in non-conda environment.

  • psutil installation log in conda-env
(torchenv) USL07109:serve harsh_bafna$ pip install psutil
Collecting psutil
  Using cached https://files.pythonhosted.org/packages/73/93/4f8213fbe66fc20cb904f35e6e04e20b47b85bee39845cc66a0bcf5ccdcb/psutil-5.6.7.tar.gz
Building wheels for collected packages: psutil
  Building wheel for psutil (setup.py) ... done
  Created wheel for psutil: filename=psutil-5.6.7-cp37-cp37m-macosx_10_14_x86_64.whl size=226873 sha256=96405693ec93dbabaa93d349999a4c46617020e2aa82e8449027d4c95d8f9955
  Stored in directory: /Users/harsh_bafna/Library/Caches/pip/wheels/52/41/b0/bf50409fe2b1d3b79afa3eed71b54b3e30fe5b695db2c7ba2e
Successfully built psutil
Installing collected packages: psutil
Successfully installed psutil-5.6.7
  • psutil installation log in non-conda-env
USL07109:serve harsh_bafna$ pip3 install psutil
Collecting psutil
Installing collected packages: psutil
Successfully installed psutil-5.6.7

We have already added the following steps in the README for conda environment which installs the psutil before installing torchserve using pip install . :

conda install psutil pytorch torchvision torchtext -c pytorch

harshbafna avatar Feb 13 '20 14:02 harshbafna