Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing module name tomli #608

Closed
RouquinBlanc opened this issue Aug 27, 2021 · 39 comments
Closed

Missing module name tomli #608

RouquinBlanc opened this issue Aug 27, 2021 · 39 comments

Comments

@RouquinBlanc
Copy link

Since the release of setuptools_scm 6.1.1 a few minutes ago, our jenkins jobs are failing on the following error:

Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/nidar-orchid_master/setup.py", line 7, in <module>
    setuptools.setup(
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/distutils/core.py", line 108, in setup
    _setup_distribution = dist = klass(attrs)
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/site-packages/setuptools/dist.py", line 434, in __init__
    _Distribution.__init__(self, {
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/distutils/dist.py", line 292, in __init__
    self.finalize_options()
  File "/root/.pyenv/versions/3.9.5/lib/python3.9/site-packages/setuptools/dist.py", line 743, in finalize_options
    ep(self)
  File "/var/lib/jenkins/workspace/nidar-orchid_master/.eggs/setuptools_scm-6.1.1-py3.9.egg/setuptools_scm/integration.py", line 52, in infer_version
    config = Configuration.from_file(dist_name=dist_name)
  File "/var/lib/jenkins/workspace/nidar-orchid_master/.eggs/setuptools_scm-6.1.1-py3.9.egg/setuptools_scm/config.py", line 187, in from_file
    defn = _load_toml(data)
  File "/var/lib/jenkins/workspace/nidar-orchid_master/.eggs/setuptools_scm-6.1.1-py3.9.egg/setuptools_scm/config.py", line 59, in _lazy_tomli_load
    from tomli import loads
ModuleNotFoundError: No module named 'tomli'

Maybe a missing dependency somewhere?

@Limess
Copy link

Limess commented Aug 27, 2021

We're also seeing this issue and it's blocking all of our pip installs + builds

DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
       pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
        ERROR: Command errored out with exit status 1:
         command: /home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/bin/python /home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpgbvrelz1
             cwd: /tmp/pip-req-build-waap9ppu
        Complete output (32 lines):
        /tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/git.py:94: UserWarning: "/tmp/pip-req-build-waap9ppu" is shallow and may cause errors
          warnings.warn(f'"{wd.path}" is shallow and may cause errors')
        Traceback (most recent call last):
          File "/home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
            main()
          File "/home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "/home/circleci/.cache/pre-commit/repoenxu__py/py_env-python3/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 151, in prepare_metadata_for_build_wheel
            return hook(metadata_directory, config_settings)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 166, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 150, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 48, in <module>
            setup(
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
          File "/home/circleci/.pyenv/versions/3.9.6/lib/python3.9/distutils/core.py", line 108, in setup
            _setup_distribution = dist = klass(attrs)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 455, in __init__
            _Distribution.__init__(self, {
          File "/home/circleci/.pyenv/versions/3.9.6/lib/python3.9/distutils/dist.py", line 292, in __init__
            self.finalize_options()
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 807, in finalize_options
            ep(self)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/integration.py", line 52, in infer_version
            config = Configuration.from_file(dist_name=dist_name)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/config.py", line 187, in from_file
            defn = _load_toml(data)
          File "/tmp/pip-build-env-rly7bdkv/overlay/lib/python3.9/site-packages/setuptools_scm/config.py", line 59, in _lazy_tomli_load
            from tomli import loads
        ModuleNotFoundError: No module named 'tomli'

@andy-maier
Copy link

+1
Had the same issue and was just about to open an issue here ;-)

In my case it happens when pip builds a wheel for the "lazy-object-proxy" package. We are not explicitly installing "setuptools-scm", but it seems that Pip uses it under the covers when building a wheel.

Test run that fails: https://github.com/zhmcclient/zhmc-ansible-modules/pull/450/checks?check_run_id=3442020780#step:10:373

@FabianNiehaus
Copy link

FabianNiehaus commented Aug 27, 2021

Same here occuring during the installation of black using pre-commit:

[INFO] Installing environment for https://github.com/psf/black.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\Arbeit\\.cache\\pre-commit\\repojrwwndw1\\py_env-python3\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
expected return code: 0
stdout:
    Processing c:\users\arbeit\.cache\pre-commit\repojrwwndw1
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
        Preparing wheel metadata: started
        Preparing wheel metadata: finished with status 'error'

stderr:
      DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
       pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
        ERROR: Command errored out with exit status 1:
         command: 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\Scripts\python.EXE' 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Arbeit\AppData\Local\Temp\tmpne3a6s_5'
             cwd: C:\Users\Arbeit\AppData\Local\Temp\pip-req-build-79_7d_fq
        Complete output (32 lines):
        C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\git.py:94: UserWarning: "C:\Users\Arbeit\AppData\Local\Temp\pip-req-build-79_7d_fq" is shallow and may cause errors
          warnings.warn(f'"{wd.path}" is shallow and may cause errors')
        Traceback (most recent call last):
          File "C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 280, in <module>
            main()
          File "C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 263, in main
            json_out['return_val'] = hook(**hook_input['kwargs'])
          File "C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py", line 133, in prepare_metadata_for_build_wheel
            return hook(metadata_directory, config_settings)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\build_meta.py", line 166, in prepare_metadata_for_build_wheel
            self.run_setup()
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\build_meta.py", line 150, in run_setup
            exec(compile(code, __file__, 'exec'), locals())
          File "setup.py", line 48, in <module>
            setup(
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\__init__.py", line 153, in setup
            return distutils.core.setup(**attrs)
          File "C:\Python\Python-3.8.6-x64\lib\distutils\core.py", line 108, in setup
            _setup_distribution = dist = klass(attrs)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\dist.py", line 455, in __init__
            _Distribution.__init__(self, {
          File "C:\Python\Python-3.8.6-x64\lib\distutils\dist.py", line 292, in __init__
            self.finalize_options()
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools\dist.py", line 807, in finalize_options
            ep(self)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\integration.py", line 52, in infer_version
            config = Configuration.from_file(dist_name=dist_name)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\config.py", line 187, in from_file
            defn = _load_toml(data)
          File "C:\Users\Arbeit\AppData\Local\Temp\pip-build-env-bzerucjz\overlay\Lib\site-packages\setuptools_scm\config.py", line 59, in _lazy_tomli_load
            from tomli import loads
        ModuleNotFoundError: No module named 'tomli'
        ----------------------------------------
    WARNING: Discarding file:///C:/Users/Arbeit/.cache/pre-commit/repojrwwndw1. Command errored out with exit status 1: 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\Scripts\python.EXE' 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' p
repare_metadata_for_build_wheel 'C:\Users\Arbeit\AppData\Local\Temp\tmpne3a6s_5' Check the logs for full command output.
    ERROR: Command errored out with exit status 1: 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\Scripts\python.EXE' 'C:\Users\Arbeit\.cache\pre-commit\repojrwwndw1\py_env-python3\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\Arbeit\AppData\Local\Temp\t
mpne3a6s_5' Check the logs for full command output.

@hieplpvip
Copy link

Same issue here. I've tried pip install tomli but no results.

@fredley
Copy link

fredley commented Aug 27, 2021

Adding to this pileon, I am affected by this

@babolivier
Copy link

Same here, I assume #607 is the culprit.

@eljulians
Copy link

Same here

@PythonicNinja
Copy link
Contributor

Same issue 👍

@andy-maier
Copy link

andy-maier commented Aug 27, 2021

A well used package - Nine projects reported an issue within 16 minutes :-)

I can see that the METADATA file in the setuptools-scm 6.1.1 package pulls in tomli as part of an extra "tomli", but it seems that Pip when it uses setuptools-scm under the covers does not install that extra, and setuptools-scm seems to depend on tomli even when the "tomli" extra is not installed.

So if tomli is really an optional extra, then setuptools-scm should not fail when it is not there. If it is required, it should not be an extra. At least IMHO.

@jithurjacob
Copy link

It's a Friday evening and I'm sitting with a broken CI 😭

@La0
Copy link

La0 commented Aug 27, 2021

Broken CI here too 🙅

@hsuanguo
Copy link

broken CI here as well

@fredley
Copy link

fredley commented Aug 27, 2021

Has anyone figured a workaround? I've tried, prior to my pip install -r requirements.txt, adding pip install tomli (didn't work), adding pip install setuptools-scm!=6.1.1 (didn't work). It seems the setuptools pip uses is separate from the one it installs itself.

@mxschmitt
Copy link

cc @RonnyPfannschmidt who made the transition from toml to tomli in #586.

@RonnyPfannschmidt
Copy link
Contributor

i just returned to the computer to yank this release as well, it seems i will have to re engineer the way this is tested to stop missing those issues until reports pour in , a new release with the issue resolved will land later today

@yangchoo
Copy link

Has anyone figured a workaround? I've tried, prior to my pip install -r requirements.txt, adding pip install tomli (didn't work), adding pip install setuptools-scm!=6.1.1 (didn't work). It seems the setuptools pip uses is separate from the one it installs itself.

You'll want to pin setuptools-scm in your setup.cfg or pyproject.toml file.

@carlosperate
Copy link

I just wanted to say a HUGE THANK YOU @RonnyPfannschmidt, for all your work on setuptools_scm and being able to quickly mitigate this issue.

In open source is easy to get a lot of attention when things stop working, without the much deserved appreciation the maintainers deserve.

@JohnPaton
Copy link

JohnPaton commented Aug 27, 2021

+1 for that, the bad version was yanked within the hour and my builds are all ✅ again

Great work @RonnyPfannschmidt 🍰 ✨ 🏆 ⭐

mkoura added a commit to mkoura/cardano-node-tests that referenced this issue Aug 27, 2021
opennode-jenkins pushed a commit to waldur/waldur-mastermind that referenced this issue Aug 27, 2021
@pllim
Copy link

pllim commented Sep 3, 2021

Yes, I see it at https://readthedocs.org/projects/astropy/builds/14629185/

@sourcecodeit
Copy link

same here 👋

@grantmagdanz
Copy link

Same, seeing CI failures because of this now.

@kilonzi
Copy link

kilonzi commented Sep 3, 2021

I am seeing the same issue in CI.

@Buffer0x7cd
Copy link

Same here 👋

@dfilipp
Copy link

dfilipp commented Sep 3, 2021

Same here

@wajdi-farhani-servier
Copy link

wajdi-farhani-servier commented Sep 3, 2021

Same here ! a Friday evening 🥲

@mathpluscode
Copy link

Same here 🆘

@jeska
Copy link

jeska commented Sep 3, 2021

We're also experiencing this, but I'm going to work through pinning a prior version to see if it solves it in the interim for us.

Sending good vibes to the maintainers for the work they're putting in to monitor & fix this 💟 🥂

@chrisrodz
Copy link

Also experiencing the issue. Good vibes and happy Friday to all! ❤️

@browniebroke
Copy link

Fix is already going up, no need to comment "Same here" #628

@toshitanian
Copy link

Still failing on github actions....

@ca-scribner
Copy link

just worked for me

@wajdi-farhani-servier
Copy link

Back to normal... Thanks for the quick resolution! 👍

@codingfiddler
Copy link

codingfiddler commented Sep 3, 2021

Thanks so much! This was the fastest fix I've ever seen, our intern and I thank you :D

@rsb177
Copy link

rsb177 commented Sep 3, 2021

lol...thanks @RonnyPfannschmidt for the lightning quick fix! my CI builds thank you too!

@kilonzi
Copy link

kilonzi commented Sep 3, 2021

Thanks @RonnyPfannschmidt , you saved my Friday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests