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

Can't detect mypy anymore #19

Closed
nmatthews-asapp opened this issue Apr 4, 2019 · 9 comments
Closed

Can't detect mypy anymore #19

nmatthews-asapp opened this issue Apr 4, 2019 · 9 comments
Labels

Comments

@nmatthews-asapp
Copy link

I use pyenv, and have mypy installed in an environment I use for python-related plugins: atom_env_3.6.7. I set the path of mypy to reflect the correct python installation.

The error message says

The python package mypy does not seem to be installed. Install it with:

/my/path/to/home/.pyenv/versions/3.6.7/envs/atom_env_3.6.7/bin/python -m pip install mypy

But if I run

/my/path/to/home/.pyenv/versions/3.6.7/envs/atom_env_3.6.7/bin/python -m pip list

I get

Package                Version
---------------------- -------
autopep8               1.4.3
...
mypy                   0.700
...

And running the suggested install command does nothing because it's already installed

This started happening recently, so in the last one or two updates

@elarivie
Copy link
Owner

elarivie commented Apr 5, 2019

Hello @nmatthews-asapp,

  • Can you try running the following:
    /my/path/to/home/.pyenv/versions/3.6.7/envs/atom_env_3.6.7/bin/python -m mypy --version

It will either show the mypy version or "No module named mypy"

From your your issue description I am pretty sure it will print "No module named mypy"

Because this is the string which when detected by linter-mypy triggers the pop-up that you receive about "mypy does not seem to be installed"

I am not an expert of pyenv but I am pretty sure that you need to validate your pyenv configuration.

Note that the suggested install command that linter-mypy displays in the pop-up is a "suggestion" which works most of the time" but in your python virtual environment configuration maybe it is another command line that you need to use.

Maybe pyenv is changing some environment variable and if you don't launch atom within that context than the python installation is in an hybrid/unusable state.

Note: does pyenv have some kind of activation command which needs to be launch first to activate the environment (which need to be call prior to launch the installation of mypy?, before launching atom?)

Let me know if you make progress or find the solution to your issue.

Note: See #18 which was recently solve and is also about a linter-mypy user using a python virtual environment, it may contains information which could help you with the issue that you have.

@CesarLanderos
Copy link

image

i get this and doing /.../python -m mypy --version gives me:

mypy 0.670

@CesarLanderos
Copy link

CesarLanderos commented Apr 10, 2019

it used to just work before i updated the package

@elarivie
Copy link
Owner

Hello @CesarLanderos,

Note: The issue that you describe is different than the one reported by @nmatthews-asapp

Note. linter-mypy always aim to support the "latest" version of Mypy so from time to time mypy must be updated.

@CesarLanderos, in your situation you have to update Mypy has the pop-up is telling you, from the details that you provided I see that you have mypy 0.670 installed... but linter-mypy has recently been updated to fully support the latest version of Mypy which is currently 0.700. So effectively mypy 0.700 has command line arguments which were not present in prior version.

Within the pop-up the suggested command line that is shown in the pop-up contains:
... -m pip install -U mypy
The -U parameter is to "Update"

Note: From the python path in your screen shot I see that you are using a python environment, so maybe in your situation the actual command line to update mypy is different.

@CesarLanderos Let me know if this solves your issue.

@nmatthews-asapp Did you resolve your issue?

@CesarLanderos
Copy link

thanks for the response, i do agree, this is a different issue.

your suggestion did not fix the issue, this is what i have now when i print the version:

mypy 0.700

@CesarLanderos
Copy link

CesarLanderos commented Apr 11, 2019

ah! ignore that message, it is working now 😅

thanks!!!

i realize that this was my fault for not actually reading the error message 😓

@nmatthews-asapp
Copy link
Author

nmatthews-asapp commented Apr 19, 2019

@elarivie

When I run

/path/to/home/.pyenv/versions/3.6.7/envs/atom_env_3.6.7/bin/python -m mypy --version

I get: mypy 0.701
I do activate my environment before starting Atom and given that, I can also run python -m mypy --version and get the same result

@elarivie
Copy link
Owner

4 Months without new information, closing this issue...

@str225
Copy link

str225 commented Apr 4, 2020

I'm having the same problem: If i uninstall mypy globally, create a virtual environment and install mypy on it. I can run mypy from the terminal from inside the virtual environment, but, even after running atom from inside the venv, linter-mypy can't find mypy.

Shouldn't it use the venv mypy instead of the global one ?

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

No branches or pull requests

4 participants