Comments (5)
Hello @ShadowLNC,
TLTR: Your issue seems to be relatedd to a python2 vs python3 mixup.
I don't know if they are typos in your issue description but sometimes you mention 'python' and sometimes your mention 'python3'.
On ubuntu 'python' is pointing to python2
Note that python2 end of life is January 1st 2020... so you should be using python3 everywhere by now.
I can confirm that the message that your receive is not a linter-mypy bug, in fact linter-mypy is perfectly doing its job of showing you the error message provided by mypy.
Make sure that the linter-mypy setting is using python3 (its the default value unless you have written something in that textbox)
Effectively mypy needs typed-ast to run and if you run the command
python3 -m pip install -U typed-ast
It will install it
You can try to uninstall it first just in case (to start clean)
python3 -m pip uninstall typed-ast
python3 -m pip uninstall mypy
python3 -m pip install -U mypy
python3 -m pip install -U typed-ast
But then even if they are are correctly installed in the python3 packages... if you are using the executable of python2 it will keep complaining that they are not installed.
Let me know if it solves your issue.
from linter-mypy.
Thanks for the response!
I'm using a virtual environment, hence the python
binary (which is a Python3 virtual environment), is it required to use the user packages directory? I'm not sure how mypy
is being invoked, and whether typed-ast
is actually available (on the path) at runtime.
My executable path for linter-mypy is /home/scott/.atom/venv/bin/python
.
from linter-mypy.
@ShadowLNC I just wrote this small script to help you debug your environment:
Use this script as a wrapper to inspect parameters and environment variables being use
#!/bin/sh
# You can use this script to debug linter-mypy in your environment.
# It basically wrap python3 calls
#1 - Define an output file somewhere on your disk:
outputfile=~/linter-mypy_debug.txt
#2 - Make this script executable (chmod +x linter-mypy_X)
#3 - Change linter-mypy settings to use the current script as a pseudo python executable.
#4 - Within atom trigger a lint process of a file.
#5 - Look at the content of the outputfile
# Clear the output file content
echo "" > "$outputfile"
# The following command will send every parameters received to the output file
echo "PARAMETERS" >> "$outputfile"
echo "$@" >> "$outputfile"
# The following commands will send some important environment variables to the output file
echo "PATH" >> "$outputfile"
echo $PATH >> "$outputfile"
echo "MYPYPATH" >> "$outputfile"
echo $MYPYPATH >> "$outputfile"
echo "PYTHONPATH" >> "$outputfile"
echo $PYTHONPATH >> "$outputfile"
# The following command will send the current working directory path to the output file
echo "Current Working Directory" >> "$outputfile"
pwd >> "$outputfile"
# Forward the call to python3 including all the parameters received so that linter-mypy gets lint output
python3 "$@"
from linter-mypy.
Thanks 😄
(Apologies - I responded yesterday but it seems it didn't submit?)
Seems like somehow the PYTHONPATH
environment variable is being modified and is copied from the PYTHONPATH
setting from the linter-pylint plugin. This doesn't always happen, so I suspect a race condition (and linter-pylint is probably modifying the environment which is then picked up by linter-mypy). When PYTHONPATH
is empty, everything works as expected.
I've filed the bug with linter-pylint as referenced above, but in the meantime, would it please be possible to add a setting to linter-mypy for the PYTHONPATH
variable?
from linter-mypy.
Hi @ShadowLNC,
In linter-mypy v2.6.9
1- PYTHONPATH can now be specified
2- There is now a more user friendly message if typed-ast is not present
from linter-mypy.
Related Issues (20)
- Feature request: Add $PROJECT_PATH and $PROJECT_NAME resolution for MYPYPATH setting. HOT 3
- Add option to only check repos where mypy.ini is present HOT 3
- Object.dirname is deprecated. HOT 2
- Doesn't find imports >= 5 levels deep HOT 1
- Can you expose the option of specifying a cache folder HOT 7
- Unable to find installed modules HOT 3
- UnicodeEncodeError HOT 1
- Does not seem to work with pipenv HOT 2
- Can't detect mypy anymore HOT 9
- linter-mypy generating many duplicate errors HOT 2
- Read settings from setup.cfg HOT 2
- Errors are shown on incorrect files HOT 3
- Option to start the mypy process from the (Atom) project directory? HOT 3
- Package is showing internal mypy errors although turned off HOT 6
- (semi-) colon separated Python Executable Path? HOT 5
- Are mypy plugins supported ? HOT 5
- Unable to find mypy, despite correct $PATH and settings HOT 3
- How can I set $MYPYPATH so that the linter will pick up on it? HOT 1
- $PROJECT_NAME is invalid in case project folder contains dot. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linter-mypy.