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.

MacOS: Error while checking Mypy path

See original GitHub issue

Step 1: Are you in the right place?

  • I have verified there are no duplicate active or recent bugs, questions, or requests
  • I have verified that I am using the latest version of the plugin.

Step 2: Describe your environment

  • Plugin version: 0.10.2
  • PyCharm/IDEA version: 2018.3.4 Build #PY-183.5429.31
  • Mypy version: 0.620

Step 3: Describe the problem:

Steps to reproduce:

  1. Install mypy using brew install mypy
  2. Restart pycharm

Observed Results:

  • Pycharm indicates a fatal error “Error while checking Mypy path”

Expected Results:

  • Pycharm should load without complaining

Relevant Code:

I think the plugin is throwing an error when executing the /usr/local/bin/mypy file as installed by brew but I can’t see why. This file contains:

#!/bin/bash
PYTHONPATH="/usr/local/Cellar/mypy/0.620/libexec/lib/python3.7/site-packages:/usr/local/Cellar/mypy/0.620/libexec/vendor/lib/python3.7/site-packages" exec "/usr/local/Cellar/mypy/0.620/libexec/bin/mypy" "$@"
java.lang.Throwable: Error while checking Mypy path:   File "/usr/local/bin/mypy", line 2
    PYTHONPATH="/usr/local/Cellar/mypy/0.620/libexec/lib/python3.7/site-packages:/usr/local/Cellar/mypy/0.620/libexec/vendor/lib/python3.7/site-packages" exec "/usr/local/Cellar/mypy/0.620/libexec/bin/mypy" "$@"
                                                                                                                                                             ^
SyntaxError: invalid syntax
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:134)
	at com.leinardi.pycharm.mypy.mpapi.MypyRunner.isMypyPathValid(MypyRunner.java:102)
	at com.leinardi.pycharm.mypy.mpapi.MypyRunner.checkMypyAvailable(MypyRunner.java:176)
	at com.leinardi.pycharm.mypy.mpapi.MypyRunner.checkMypyAvailable(MypyRunner.java:152)
	at com.leinardi.pycharm.mypy.MypyInspection.inspectFile(MypyInspection.java:76)
	at com.leinardi.pycharm.mypy.MypyInspection.lambda$checkFile$0(MypyInspection.java:65)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.call(ApplicationImpl.java:337)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

image

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:9
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Daenythcommented, Feb 11, 2019

I see a similar problem on OSX using the path of mypy inside my project’s venv, using Intellij with the python plugin

2reactions
tj800xcommented, Apr 14, 2019

I had this issue with pyenv with both python 2.7 and python 3.7 installed. Once I was able to resolve down to a single version I was able to take the output of pyenv which mypy and paste it into the path to mypy executable (preferences/mypy) and everything worked fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Common issues and solutions - mypy 0.991 documentation
Common issues and solutions# · Can't install mypy using pip# · No errors reported for obviously wrong code# · Spurious errors and locally...
Read more >
Unable to find mypy.ini configuration file on Mac
I have installed the mypy module and want to update the module path in the config file. I tried to find the file...
Read more >
Changelog — Python 3.11.1 documentation
gh-94526: Fix the Python path configuration used to initialized sys.path at Python startup. Paths are no longer encoded to UTF-8/strict to avoid encoding...
Read more >
How to install mypy on Mac
To use mypy, You need Python 3.4 or later. You can have multiple Python versions (2.x and 3.x) installed on the same system...
Read more >
mypy - Pants build
The MyPy Python type checker (http://mypy-lang.org/). ... skip --[no-]mypy-skip PANTS_MYPY_SKIP default: False If true, don't use MyPy when running .
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