Thanks to visit codestin.com
Credit goes to github.com

Skip to content

mypy cannot find module installed as editable by pip #7508

@tsoernes

Description

@tsoernes

I have a module installed as editable by pip, i.e. pip install -e ... Mypy cannot import it, even when run as python -m mypy:

feed.py:10: error: Cannot find module named 'rsspull.article'
feed.py:11: error: Cannot find module named 'rsspull.feedparser_types'

~/.config/mypy/config:

[mypy]
mypy_path = '/home/torstein/code/fintechdb/pull/RSSPull/rsspull:/home/torstein/code/fintechdb/pull/RSSPull:/home/torstein/code/fintechdb/:/home/torstein/code/fintechdb/Ftools/ftools:/home/torstein/anaconda3/envs/rss/lib/python3.7/site-packages/'

Installing a module as editable creates an egg link in the virtual env, whatever that is:

$ fd rsspull ~/anaconda3/envs/rss                                                                                              
/home/torstein/anaconda3/envs/rss/lib/python3.7/site-packages/rsspull.egg-link
mypy               0.720     
mypy-extensions    0.4.1 

(I'm running mypy inside of the anaconda virtual env. Python is able to find the module)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions