cthoyt / zenodo-client

A tool for automated uploading and version management of scientific data to Zenodo
MIT License
25 stars 5 forks source link

Error with library py when running tox #22

Closed nuest closed 1 year ago

nuest commented 1 year ago
 tox
Traceback (most recent call last):
  File "/usr/bin/tox", line 33, in <module>
    sys.exit(load_entry_point('tox==3.21.4', 'console_scripts', 'tox')())
  File "/usr/bin/tox", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/lib/python3/dist-packages/tox/__init__.py", line 32, in <module>
    from .session import cmdline  # isort:skip
  File "/usr/lib/python3/dist-packages/tox/session/__init__.py", line 20, in <module>
    from tox import reporter
  File "/usr/lib/python3/dist-packages/tox/reporter.py", line 127, in <module>
    _INSTANCE = Reporter()
  File "/usr/lib/python3/dist-packages/tox/reporter.py", line 32, in __init__
    self._reset(**kwargs)
  File "/usr/lib/python3/dist-packages/tox/reporter.py", line 38, in _reset
    self.tw = py.io.TerminalWriter()
AttributeError: module 'py' has no attribute 'io'

python3 -m pip install py does not solve the problem.

I have no experience with tox, so any pointer would be appreciated!

nuest commented 1 year ago
$ pip list
Package            Version    Editable project location
------------------ ---------- -----------------------------------------
annotated-types    0.5.0
certifi            2023.7.22
charset-normalizer 3.2.0
click              8.1.6
idna               3.4
more-click         0.1.2
pip                22.0.2
py                 1.11.0
pydantic           2.1.1
pydantic_core      2.4.0
pystow             0.5.0
requests           2.31.0
setuptools         59.6.0
tqdm               4.66.1
typing_extensions  4.7.1
urllib3            2.0.4
zenodo-client      0.3.3.dev0 /home/daniel/git/NFDI4Earth/zenodo-client
cthoyt commented 1 year ago

Your pip list doesn't appear to have tox in it, so there might be some issues with your local environment setup.

Further, from the traceback, it appears you're using an old version of tox from 2021 (v3.21.4), try

python -m pip install --upgrade tox
python -m tox

This will make sure that tox is installed and run from the same version of python. You can use python -m pip list to get more exact information later

nuest commented 1 year ago

Tests are running! Thanks!