Comments (21)
I haven't been able to reproduce that yet - could you tell me what version of you have installed?
from prospector.
Master on Linux_x64_3.2.0-4-amd64
debian wheezy. Python 2.7 btw
from prospector.
I created a virtual machine, installed Debian, and managed to git clone
and python setup.py install
just fine. Odd.
What happens if you run python -c 'import pylint_common'
?
from prospector.
works fine
from prospector.
Btw when I read my first comment it appears that I'm saying that the installation fails. What I meant to say is that this fails:
sjuul@development01:~/workspace/oversight$ python -c 'import pylint_common'
sjuul@development01:~/workspace/oversight$ prospector
Traceback (most recent call last):
File "/usr/local/bin/prospector", line 9, in <module>
load_entry_point('prospector==0.5.1', 'console_scripts', 'prospector')()
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/run.py", line 186, in main
summary, messages = prospector.execute()
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/run.py", line 131, in execute
tool.prepare(self.path, self.ignores, self.config, self.adaptors)
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/tools/pylint/__init__.py", line 83, in prepare
adaptor.adapt_pylint(linter)
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/adaptor/common.py", line 8, in adapt_pylint
linter.load_plugin_modules(['pylint_common'])
File "/usr/local/lib/python2.7/dist-packages/pylint-1.1.0-py2.7.egg/pylint/lint.py", line 357, in load_plugin_modules
module = load_module_from_name(modname)
File "/usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg/logilab/common/modutils.py", line 125, in load_module_from_name
return load_module_from_modpath(dotted_name.split('.'), path, use_sys)
File "/usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg/logilab/common/modutils.py", line 167, in load_module_from_modpath
mp_file, mp_filename, mp_desc = find_module(part, path)
ImportError: No module named pylint_common
from prospector.
Ah, ok, that makes a bit more sense! It seems to run okay for me - does it only fail in your oversight
directory? What if you clone something like https://github.com/carlio/django-flows somewhere else and run prospector
? (That's the repo I used to test and everything worked fine)
from prospector.
What I suspect is that you have a slightly different $PYTHONPATH
or something to me - the sys.path
gets fiddled with a bit by pylint
from prospector.
juul@development01:~/workspace/django-flows$ prospector
Traceback (most recent call last):
File "/usr/local/bin/prospector", line 9, in <module>
load_entry_point('prospector==0.5.1', 'console_scripts', 'prospector')()
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/run.py", line 186, in main
summary, messages = prospector.execute()
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/run.py", line 131, in execute
tool.prepare(self.path, self.ignores, self.config, self.adaptors)
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/tools/pylint/__init__.py", line 83, in prepare
adaptor.adapt_pylint(linter)
File "/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg/prospector/adaptor/common.py", line 8, in adapt_pylint
linter.load_plugin_modules(['pylint_common'])
File "/usr/local/lib/python2.7/dist-packages/pylint-1.1.0-py2.7.egg/pylint/lint.py", line 357, in load_plugin_modules
module = load_module_from_name(modname)
File "/usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg/logilab/common/modutils.py", line 125, in load_module_from_name
return load_module_from_modpath(dotted_name.split('.'), path, use_sys)
File "/usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg/logilab/common/modutils.py", line 167, in load_module_from_modpath
mp_file, mp_filename, mp_desc = find_module(part, path)
ImportError: No module named pylint_common
sjuul@development01:~/workspace/django-flows$ echo $PYTHONPATH
--nothing--
I'm running on a Google compute engine instance. That might be the reason. I'm going to try on a local machine for a sec
from prospector.
Yep prospector seems to be working on a normal machine.
from prospector.
Hmm. I really can't think of what it could be, except some unusual interaction with sys.path
.
from prospector.
>>> import sys
>>> print sys.path
['', '/usr/local/lib/python2.7/dist-packages/prospector-0.5.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pep8_naming-0.2.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pep8-1.4.6-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pyflakes-0.7.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/mccabe-0.2.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/PyYAML-3.10-py2.7-linux-x86_64.egg', '/usr/local/lib/python2.7/dist-packages/dodgy-0.1.5-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/setoptconf-0.1.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/requirements_detector-0.1.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pylint_common-0.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pylint_plugin_utils-0.1.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pylint_django-0.3-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pylint_celery-0.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/pylint-1.1.0-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/astroid-1.0.1-py2.7.egg', '/usr/local/lib/python2.7/dist-packages/logilab_common-0.61.0-py2.7.egg', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-linux2', '/usr/lib/python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/dist-packages', '/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages/gtk-2.0', '/usr/lib/pymodules/python2.7']
from prospector.
I installed a copy of the code to try and develop a formatter, and after working a few times, the code suddenly throws this error for me as well.
from prospector.
I have a new theory, which is because it tries to import __pkginfo__.py
in the setup.py
. I believe this is a Stupid Thing™ in retrospect, so replacing that would probably help. I'll try to get onto it soon, but if you're interested in the formatter stuff, perhaps try removing the import from setup.py
to get it working?
from prospector.
it seems to be more than the pkginfo line, i can remove that and still get the error, just slightly differently.
techdragon 🐍 2.7 ⓔ prospector ⋯ github.com techdragon prospector python prospector/run.py -o jenkins master
Traceback (most recent call last):
File "prospector/run.py", line 202, in <module>
main()
File "prospector/run.py", line 187, in main
summary, messages = prospector.execute()
File "prospector/run.py", line 132, in execute
tool.prepare(self.path, self.ignores, self.config, self.adaptors)
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/prospector-0.0.1-py2.7.egg/prospector/tools/pylint/__init__.py", line 100, in prepare
adaptor.adapt_pylint(linter)
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/prospector-0.0.1-py2.7.egg/prospector/adaptor/common.py", line 8, in adapt_pylint
linter.load_plugin_modules(['pylint_common'])
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/pylint-1.2.1-py2.7.egg/pylint/lint.py", line 359, in load_plugin_modules
module = load_module_from_name(modname)
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/logilab_common-0.62.0-py2.7.egg/logilab/common/modutils.py", line 125, in load_module_from_name
return load_module_from_modpath(dotted_name.split('.'), path, use_sys)
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/logilab_common-0.62.0-py2.7.egg/logilab/common/modutils.py", line 167, in load_module_from_modpath
mp_file, mp_filename, mp_desc = find_module(part, path)
ImportError: No module named pylint_common
from prospector.
Also, since it may be relevant ... when i try to run from the source code after removing the built package from the virtualenv but leaving all the dependencies in place... I get a different alltogether more disturbing error.
techdragon 🐍 2.7 ⓔ prospector ⋯ github.com techdragon prospector python prospector/run.py -o jenkins master
Traceback (most recent call last):
File "prospector/run.py", line 8, in <module>
from prospector import config as cfg, tools, blender
ImportError: No module named prospector
after purging all the prospector based imports in order to ensure that it was running entirely from the current state of my py files in my git repo fork of this, it comes right back, to the same error pretty much
techdragon 🐍 2.7 ⓔ prospector ⋯ github.com techdragon prospector python prospector/run.py -o jenkins 1 master
Traceback (most recent call last):
File "prospector/run.py", line 210, in <module>
main()
File "prospector/run.py", line 195, in main
summary, messages = prospector.execute()
File "prospector/run.py", line 140, in execute
tool.prepare(self.path, self.ignores, self.config, self.adaptors)
File "/Users/techdragon/dev/github.com/techdragon/prospector/prospector/tools/pylint/__init__.py", line 100, in prepare
adaptor.adapt_pylint(linter)
File "/Users/techdragon/dev/github.com/techdragon/prospector/prospector/adaptor/common.py", line 8, in adapt_pylint
linter.load_plugin_modules(['pylint_common'])
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/pylint-1.2.1-py2.7.egg/pylint/lint.py", line 359, in load_plugin_modules
module = load_module_from_name(modname)
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/logilab_common-0.62.0-py2.7.egg/logilab/common/modutils.py", line 125, in load_module_from_name
return load_module_from_modpath(dotted_name.split('.'), path, use_sys)
File "/Users/techdragon/.virtualenvs/prospector/lib/python2.7/site-packages/logilab_common-0.62.0-py2.7.egg/logilab/common/modutils.py", line 167, in load_module_from_modpath
mp_file, mp_filename, mp_desc = find_module(part, path)
ImportError: No module named pylint_common
from prospector.
This is because import and find_module do not work the same way. find_module will choke on egg's which are files and not directories.
Do the following:
import pylint_common # this will work
print pylint_common # verify that the output of this is an egg file, not an egg dir
imp.find_module('pylint_common') # this will fail
The workaround is to force setup.py to install all reqs as dir instead of zip using:
sudo python setup.py easy_install -Z .
For further info, see:
https://mail.python.org/pipermail/distutils-sig/2010-December/017147.html
https://pythonhosted.org/setuptools/setuptools.html (always-unzip option)
http://stackoverflow.com/questions/7403738/importerror-no-module-named-suds
http://stackoverflow.com/questions/2604600/why-does-easy-install-extract-some-python-eggs-and-not-others
http://stackoverflow.com/questions/2798451/python-why-do-some-packages-get-installed-as-eggs-and-some-as-egg-folders
You may need to go into the site-packages directory and manually delete or uninstall things which have been installed an zip eggs.
from prospector.
Thanks for this information, that's really helpful. It sounds like I could fix this by making the landscapeio/pylint_common library specify zip_safe=False
in its setup.py
. I will probably raise this on pylint too, as it would suggest that any plugin installed as a zip'd egg would fail.
from prospector.
This fix to pylint-common should improve things: landscapeio/pylint-common@e43c88f
New virtualenvs should pull in the most up-to-date version of pylint-common (0.2.1) and hopefully fix this problem. Thanks again @ustun!
from prospector.
Not sure, but other packages like pylint-celery might need the same fix:
https://github.com/landscapeio/pylint-celery/blob/master/setup.py
from prospector.
Oh good point. I tried it with pylint-django, which seemed okay without the fix. I'll test it with pylint-celery now.
from prospector.
Done in this commit: pylint-dev/pylint-celery@2c17188
from prospector.
Related Issues (20)
- [BUG] Mypy is described as experimental when it's now stable HOT 1
- [BUG] prospector2 won't install on Windows apparently since using forward slash instead of os.path.join HOT 1
- Prospector 1.10.2 does not support `with_mypy` optional tool [in conda] HOT 5
- [BUG] prospector fails when pyproject.toml contain multiple constraints dependencies
- [FEATURE REQUEST] MyPy check-untyped-defs option.
- [BUG] Incorrect additional_dependencies documentation to run prospector as a pre-commit hook with mypy support HOT 2
- [BUG] toml support is incomplete HOT 1
- [PKG SUPPORT] `pylint <3` and Python 3.12 HOT 11
- [PKG SUPPORT] changes for support of `flake >=6.0.0` (and Python 3.12, implicit) HOT 3
- [BUG] pre-commit hook fails on Python 3.12 because of deprecated pkg_resources HOT 3
- [BUG] False positive E231 error in pycodestyle HOT 3
- [BUG] Fatal error pylint: astroid-error HOT 1
- [FEATURE REQUEST] How to use `prospector` on a string
- [BUG] missing dependency: setuptools HOT 1
- [BUG] Crash with ValueError HOT 1
- [BUG] prospector fails with UnicodeDecodeError on requirements.txt having DOS (CRLF) line endings HOT 2
- [BUG] `prospector[with_pyroma]` not appearing to install pyroma when creating conda environments
- [FEATURE REQUEST] Baseline generation
- [BUG] Strange errors with python version 3.12.3
- [BUG] Python 3.12.2/4 - ModuleNotFoundError: No module named 'pkg_resources' HOT 1
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 prospector.