pylint

pylint false positive E0401 import errors in vscode while using venv

亡梦爱人 提交于 2020-02-19 09:59:09
问题 I created a venv using python3.6 on my mac os in this folder /Users/kim/Documents/Apps/PythonApps/python36-miros-a3 I ran a pip install pylint after I activated the virtual env My workspace is in /Users/kim/Documents/Apps/WebApps/miros-a3 Inside my vscode workspace, I have the following Workspace settings { "folders": [ { "path": "." } ], "settings": { "python.pythonPath": "/Users/kim/Documents/Apps/PythonApps/python36-miros-a3/bin/python3.6", "python.venvPath": "/Users/kim/Documents/Apps

Having pylint recognize custom module loader

江枫思渺然 提交于 2020-01-23 12:17:25
问题 I have a custom module loader that basically does some redirection. I would like pylint to recognize this custom loader. This is my situation: root/ __init__.py new/ __init__.py foo.py bar.py old/ __init__.py I have a lot of clients importing old.foo . I wrote a custom loader in old/__init__.py to redirect these to import new.foo under the hood. How do I get pylint to recognize this? When it lints import old.foo , it complains that it can't find old.foo . This is only a problem with pylint. I

which files get installed when `pip` installing `pylint`?

家住魔仙堡 提交于 2020-01-21 18:50:50
问题 I ran pip install --user pylint and did not notice any error. However, pylint foo.py throws the error pylint: command not found . Comparing with the GitHub repository it looks like I only have a subset on my computer (see below). At any rate, I don't have any file named pylint . Is there anything I can install by hand if it didn't work straight out-of-the-box? Here are the files that I have: under /Users/erc/Library/Python/2.7/lib/python/site-packages/pylint : __init__.py __init__.pyc __main_

which files get installed when `pip` installing `pylint`?

随声附和 提交于 2020-01-21 18:50:26
问题 I ran pip install --user pylint and did not notice any error. However, pylint foo.py throws the error pylint: command not found . Comparing with the GitHub repository it looks like I only have a subset on my computer (see below). At any rate, I don't have any file named pylint . Is there anything I can install by hand if it didn't work straight out-of-the-box? Here are the files that I have: under /Users/erc/Library/Python/2.7/lib/python/site-packages/pylint : __init__.py __init__.pyc __main_

How can I install the pylint for python2.7?

我怕爱的太早我们不能终老 提交于 2020-01-13 04:30:11
问题 I try to install the pylint for the python2.7 which in ubuntu 18.04, but it raises an error with this words: pip install pylint Collecting pylint Using cached https://pypi.tuna.tsinghua.edu.cn/packages/04/1f/1d3929051b45c3e4015178c5fe5bbee735fb4e362e0fc4f0fbf3f68647ad/pylint-2.1.1.tar.gz pylint requires Python '>=3.4.*' but the running Python is 2.7.15 I have been used the pip3 installed the pylint successfully for python3.6. So, how can I install the pylint for python2.7? 回答1: pylint still

Specific class for generated-members in pylint?

北战南征 提交于 2020-01-13 03:49:27
问题 I'm slightly unsure of how the generated-members of pylint works. Lets say I add the following to .pylintrc : [TYPECHECK] generated-members=commit It hides the following commit error: E1101:Instance of 'scoped_session' has no 'commit' member However, this hides commit errors in general, from what I understand. Can I somehow specify the exact class member with generated-members ? For example (pseudo): [TYPECHECK] generated-members=sqlalchemy.orm.scoped_session.commit 回答1: I had the same

Specific class for generated-members in pylint?

怎甘沉沦 提交于 2020-01-13 03:49:01
问题 I'm slightly unsure of how the generated-members of pylint works. Lets say I add the following to .pylintrc : [TYPECHECK] generated-members=commit It hides the following commit error: E1101:Instance of 'scoped_session' has no 'commit' member However, this hides commit errors in general, from what I understand. Can I somehow specify the exact class member with generated-members ? For example (pseudo): [TYPECHECK] generated-members=sqlalchemy.orm.scoped_session.commit 回答1: I had the same

Why does django-lint tell me the `auto_now_add` is deprecated?

僤鯓⒐⒋嵵緔 提交于 2020-01-10 19:35:10
问题 Hi fellow Djangonauts: I checked my project with django-lint, and it yields: W:211,16:MyModel: timestamp: Uses superceded auto_now or auto_now_add The commit message: auto_now/auto_now_add not technically deprecated, but they still suck. Why do they say auto_now/auto_now_add "suck"? I had no problem implementing the created/last-updated pattern with these two field parameters. Is there a better approach for this pattern? Custom Field classes? And why (if this approach is better) it hasn't

How do I get PyLint to recognize numpy members?

a 夏天 提交于 2020-01-09 02:54:38
问题 I am running PyLint on a Python project. PyLint makes many complaints about being unable to find numpy members. How can I avoid this while avoiding skipping membership checks. From the code: import numpy as np print np.zeros([1, 4]) Which, when ran, I get the expected: [[ 0. 0. 0. 0.]] However, pylint gives me this error: E: 3, 6: Module 'numpy' has no 'zeros' member (no-member) For versions, I am using pylint 1.0.0 (astroid 1.0.1, common 0.60.0) and trying to work with numpy 1.8.0 . 回答1: If

How do I get PyLint to recognize numpy members?

雨燕双飞 提交于 2020-01-09 02:54:08
问题 I am running PyLint on a Python project. PyLint makes many complaints about being unable to find numpy members. How can I avoid this while avoiding skipping membership checks. From the code: import numpy as np print np.zeros([1, 4]) Which, when ran, I get the expected: [[ 0. 0. 0. 0.]] However, pylint gives me this error: E: 3, 6: Module 'numpy' has no 'zeros' member (no-member) For versions, I am using pylint 1.0.0 (astroid 1.0.1, common 0.60.0) and trying to work with numpy 1.8.0 . 回答1: If