Cannot install editable package
See original GitHub issueI wanted to install a package on a local drive as an editable package under Windows:
D:\projects\myproject>pipenv install -e D:\projects\DjangoApps\mypackage
Describe your environment
- OS: Windows 10 Pro, 64 bit
- Python version: Python 3.6.1
- Pipenv version: pipenv, version 8.3.2
Expected result
the package is listed in Pipfile and myproject
finds the mypackage
dependency
Actual result
The following error occurs:
Installing -e D:\projects\DjangoApps\mypackage…
Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\program files (x86)\python36-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files (x86)\Python36-32\Scripts\pipenv.exe\__main__.py", line 9, in <module>
File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\vendor\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\cli.py", line 1880, in install
converted = convert_deps_from_pip(package_name)
File "c:\program files (x86)\python36-32\lib\site-packages\pipenv\utils.py", line 547, in convert_deps_from_pip
os.path.isfile(req.name)) and not req.vcs:
File "c:\program files (x86)\python36-32\lib\genericpath.py", line 30, in isfile
st = os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
Solution
I checked the code in pyenv/utils.py
and at the line 547, i.e. around:
[...]
if (req.uri or (os.path.isfile(req.path) if req.path else False) or
os.path.isfile(req.name)) and not req.vcs:
[...]
the error occurs because req.name
is None
. Hence the simple solution is check as for req.path
:
if (req.uri or (os.path.isfile(req.path) if req.path else False) or
(os.path.isfile(req.name) if req.name else False)) and not req.vcs:
At least on my pc it worked. The Pipfile looks as follows after installing the editable package:
[packages] … django = “==1.10.5” “-e d:\projects\djangoapps\mypackage” = “*”
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
pip install --editable does not work as expected for ... - GitHub
Using a normal pip install , this works as expected. But when using pip install -e to install both main_package and some_plugin ,...
Read more >pip Install Editable Package Produces ModuleNotFoundError
I've been facing similar issues with frappe as well, which installs all its apps in editable mode. However, the problem exists only in...
Read more >Unable to import a package installed in editable mode? - Reddit
I've run pip list to show the list of installed packages in the virtualenv and it shows up there. I don't understand why...
Read more >Unresolved references to editable packages (pip install
Currently if you install a site-package in such a way that it creates an .egg-link file pycharm does not recognize it, or add...
Read more >pip install - pip documentation v22.3.1
Ignore the installed packages, overwriting them. This can break your system if the existing package is of a different version or was installed...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chenull pipenv version 9.0 has been released with this fix, so I’m going to close this issue – let us know if there is any further problem!
@chenull that should be right, the fix from #958 hasn’t found its way into a release yet since things were in a bit of a freeze due to needing to put together a major release. I suspect we’ll see one soon