0

However, I got the same problem, when I pip install mmseg. So, what should I do?

The log is like that:

(Monocular3D) root@gpu9:~/MonoRUn$ pip3 install mmseg -i http://pypi.douban.com/simple/  --trusted-host pypi.douban.com
Looking in indexes: http://pypi.douban.com/simple/
Collecting mmseg
  Downloading http://pypi.doubanio.com/packages/f8/31/3bc9205f39cc8ab37193a6fbb24693993b2f305aba9f35b09fad882107ee/mmseg-1.3.0.tar.gz (817 kB)
     |████████████████████████████████| 817 kB 4.4 MB/s
    ERROR: Command errored out with exit status 1:
     command: /home/root/miniconda3/envs/Monocular3D/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/setup.py'"'"';
__file__='"'"'/tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-20_hddgd
         cwd: /tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-sz89ieuw/mmseg_86227a7da2734023a199ab7a10d06662/setup.py", line 6, in <module>
        reload(sys)
    NameError: name 'reload' is not defined
----------------------------------------
WARNING: Discarding http://pypi.doubanio.com/packages/c9/3a/a38acf3f3ae401082d74cd283d29a873dd3d1b77dc0c7fb28b80f0348073/mmseg-1.2.4.tar.gz#sha256=e7ba753b7bbefe54b4a7c2e27ed6714d1349e30ad6db9d7f67ce67b80b818f4c (from http://pypi.doubanio.com/simple/mmseg/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement mmseg
ERROR: No matching distribution found for mmseg
Gulzar
  • 23,452
  • 27
  • 113
  • 201
黄晨晰
  • 1
  • 1
  • 1
    [smells like a Python 2 - Python 3 issue](https://stackoverflow.com/questions/961162/reloading-module-giving-nameerror-name-reload-is-not-defined) What Python are you installing to? – Gulzar May 24 '21 at 08:12
  • Actually yes, could you go for `pip3 install mmseg`? – Koti May 24 '21 at 08:14
  • @Koti It doesn't work, get the same error. – 黄晨晰 May 26 '21 at 03:32
  • Which Python version are you using? – Koti May 27 '21 at 19:42
  • `mmseq` was last released in 2012. It very likely does not support Python 3 at all. To use it you *could* install Python 2 alongside Python 3. But I can't recommend that route. As a beginner you should not be investing time in learning Python 2. Those of us who still work in it do so purely because we are supporting or migrating legacy code. – BoarGules Aug 13 '21 at 07:39
  • @Koti OP is obviously using Python 3. `reload` is a built-in in Python 2 but moved to `importlib` in Python 3. – BoarGules Aug 13 '21 at 07:42

2 Answers2

2

The following worked for me:

pip install openmim
mim install mmsegmentation
KRG
  • 655
  • 7
  • 18
0

You may try to install the latest package version manually. Something like:

pip install mmseg==1.3.0

Koti
  • 177
  • 11
  • The log contains the origin information: `NameError: name 'reload' is not defined`. And get the error: `ERROR: Could not find a version that satisfies the requirement mmseg==1.3.0 ERROR: No matching distribution found for mmseg==1.3.0` – 黄晨晰 May 26 '21 at 03:36
  • try `pip install mmsegmentation` instead of `mmseg` – MeadowMuffins Feb 07 '22 at 08:58