question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

master: pip install -e . fails with TypeError: expected str, bytes or os.PathLike object, not NoneType

See original GitHub issue

The problem seems to be related to recent pep517/setuptools/packaging changes but is really worrig because it totally breaks packaging.

$ pip install -e .                                                                                                                                                                                                                            [15:59:21]
Obtaining file:///Users/ssbarnea/os/molecule
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    Complete output from command /Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/bin/python3.6 /Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/3q/pc1jcyjj3qqbj6_x7n4kbtqw0000gn/T/tmpjmy837ev:
    running dist_info
    creating /Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info
    writing /Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info/PKG-INFO
    writing dependency_links to /Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info/dependency_links.txt
    writing entry points to /Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info/entry_points.txt
    writing requirements to /Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info/requires.txt
    writing top-level names to /Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info/top_level.txt
    writing manifest file '/Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    writing manifest file '/Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.egg-info/SOURCES.txt'
    creating '/Users/ssbarnea/os/molecule/pip-wheel-metadata/molecule.dist-info'
    Traceback (most recent call last):
      File "/Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 207, in <module>
        main()
      File "/Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 197, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py", line 69, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/site-packages/setuptools/build_meta.py", line 113, in prepare_metadata_for_build_wheel
        _run_setup()
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/site-packages/setuptools/build_meta.py", line 72, in _run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 351, in <module>
        __name__ == '__main__' and setuptools.setup(**setup_params)
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "setup.py", line 323, in run
        return setuptools.command.dist_info.dist_info.run(self)
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/site-packages/setuptools/command/dist_info.py", line 36, in run
        bdist_wheel.egg2dist(egg_info.egg_info, dist_info_dir)
      File "/Users/ssbarnea/.pyenv/versions/3.6.7/lib/python3.6/site-packages/wheel/bdist_wheel.py", line 443, in egg2dist
        shutil.copy(license, os.path.join(self.distinfo_dir, license_filename))
      File "/Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/lib/python3.6/posixpath.py", line 80, in join
        a = os.fspath(a)
    TypeError: expected str, bytes or os.PathLike object, not NoneType

    ----------------------------------------
Command "/Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/bin/python3.6 /Users/ssbarnea/rdo/tripleo-ci/.tox/molecule/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /var/folders/3q/pc1jcyjj3qqbj6_x7n4kbtqw0000gn/T/tmpjmy837ev" failed with error code 1 in /Users/ssbarnea/os/molecule

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:15 (12 by maintainers)

github_iconTop GitHub Comments

19reactions
akash-harijancommented, Oct 14, 2021

upgrade your pip via

curl https://bootstrap.pypa.io/get-pip.py | python -

I had same problem, and I was using pip (9.0.1) version, but when I upgraded pip to (20.3.3), it got resolved.

2reactions
webknjazcommented, Apr 11, 2019

pip install --user -e .

Oh, this is totally weird. Don’t do this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

typeerror expected str bytes or os.pathlike object not int pip ...
The Python TypeError: expected str, bytes or os.PathLike object, not NoneType occurs when we try to open a file but provide a `None`...
Read more >
An error about TypeError: expected str, bytes or os.PathLike ...
It would be helpful to see some code but it looks like the a variable in a = os.fspath(a) is of type NoneType...
Read more >
expected str, bytes or os.PathLike object, not NoneType - CDO
I lost all the packages I had installed so cdo. I have this error : TypeError: expected str, bytes or os.PathLike object, not...
Read more >
Publish docs via GitHub Pages fails with 'TypeError
Publish docs via GitHub Pages fails with "TypeError: expected str, bytes or os.PathLike object, not NoneType".
Read more >
Changelog — Python 3.11.1 documentation
gh-96192: Fix handling of bytes path-like objects in os.ismount() . ... TypeError was not raised when using more than one TypeVarTuple , like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found