facebookresearch / ParlAI

A framework for training and evaluating AI models on a variety of openly available dialogue datasets.
https://parl.ai
MIT License
10.48k stars 2.1k forks source link

ImportError: parlai now requires iopath for some I/O operations. Please run `pip install iopath` #4277

Closed chikin-lau closed 2 years ago

chikin-lau commented 2 years ago
$ parlai display_data --task personachat
Traceback (most recent call last):
  File "d:\pycharmproject\rocosa\recosa-dialogue-generation-pytorch\parlai\parlai\utils\io.py", line 8, in <module>
    from iopath.common.file_io import PathManager as _PathManager
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\iopath-0.1.9-py3.8.egg\iopath\__init__.py", line 3, in <module>
    from iopath.common import LazyPath, PathManager, file_lock, get_cache_dir
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\iopath-0.1.9-py3.8.egg\iopath\common\__init__.py", line 3, in <module>
    from iopath.common.file_io import LazyPath, PathManager, file_lock, get_cache_dir
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\iopath-0.1.9-py3.8.egg\iopath\common\file_io.py", line 27, in <module>
    import portalocker  # type: ignore
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\portalocker-2.3.2-py3.8.egg\portalocker\__init__.py", line 4, in <module>
    from . import portalocker
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\portalocker-2.3.2-py3.8.egg\portalocker\portalocker.py", line 10, in <module>
    import win32con
ModuleNotFoundError: No module named 'win32con'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\pycharmproject\rocosa\recosa-dialogue-generation-pytorch\parlai\parlai\utils\io.py", line 11, in <module>
    from fvcore.common.file_io import PathManagerBase as _PathManager
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\fvcore\common\file_io.py", line 8, in <module>
    from iopath.common.file_io import (  # noqa, unused import required by some deps
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\iopath-0.1.9-py3.8.egg\iopath\__init__.py", line 3, in <module>
    from iopath.common import LazyPath, PathManager, file_lock, get_cache_dir
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\iopath-0.1.9-py3.8.egg\iopath\common\__init__.py", line 3, in <module>
    from iopath.common.file_io import LazyPath, PathManager, file_lock, get_cache_dir
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\iopath-0.1.9-py3.8.egg\iopath\common\file_io.py", line 27, in <module>
    import portalocker  # type: ignore
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\portalocker-2.3.2-py3.8.egg\portalocker\__init__.py", line 4, in <module>
    from . import portalocker
  File "e:\software\anaconda3\envs\parlai\lib\site-packages\portalocker-2.3.2-py3.8.egg\portalocker\portalocker.py", line 10, in <module>
    import win32con
ModuleNotFoundError: No module named 'win32con'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\software\Anaconda3\envs\parlai\Scripts\parlai-script.py", line 33, in <module>
    sys.exit(load_entry_point('parlai', 'console_scripts', 'parlai')())
  File "E:\software\Anaconda3\envs\parlai\Scripts\parlai-script.py", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "E:\software\Anaconda3\envs\parlai\lib\importlib\metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "E:\software\Anaconda3\envs\parlai\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "d:\pycharmproject\rocosa\recosa-dialogue-generation-pytorch\parlai\parlai\__main__.py", line 7, in <module>
    from parlai.core.script import superscript_main
  File "d:\pycharmproject\rocosa\recosa-dialogue-generation-pytorch\parlai\parlai\core\script.py", line 22, in <module>
    from parlai.core.opt import Opt
  File "d:\pycharmproject\rocosa\recosa-dialogue-generation-pytorch\parlai\parlai\core\opt.py", line 23, in <module>
    from parlai.utils.io import PathManager
  File "d:\pycharmproject\rocosa\recosa-dialogue-generation-pytorch\parlai\parlai\utils\io.py", line 13, in <module>
    raise ImportError(
ImportError: parlai now requires iopath for some I/O operations. Please run `pip install iopath`

I have installed “iopath”,but still report same error,how can I solve it? I saw another issue saying that it was downgraded to Python 3 7. However, after I downgraded to python3.7, I was prompted that Python3.8 is required during installation. thanks

stephenroller commented 2 years ago

We don't officially support windows but uses have reported success with Python 3.8 in windows.

KevinVCSFTWR commented 2 years ago

Will windows be supported in the future?

stephenroller commented 2 years ago

The main barrier to us officially supporting windows is that no one has set up CI for windows. The entire development team works on Linux (and that will never change), so we need a representative environment.

We would welcome someone going through the steps of setting up CI and documenting installation procedures. From there, the team could easily identify and fix incompatibilities.

github-actions[bot] commented 2 years ago

This issue has not had activity in 30 days. Please feel free to reopen if you have more issues. You may apply the "never-stale" tag to prevent this from happening.