I've been unsuccessfully trying to use the SublimeLinter-flake8 on my Xubuntu laptop. I have Python 3.7.7 installed through the Anaconda distribution, as well as the flake8 package. I'm also using the Anaconda IDE plugin for Sublime Text 3, with Anaconda's linting turned off.
But I keep getting the same error message whenever I type some Python code in:
SublimeLinter: #1 flake8 <untitled 25> ERROR:
=============================================
Traceback (most recent call last):
File "/home/srdjan/anaconda3/bin/flake8", line 11, in <module>
load_entry_point('flake8==3.7.7', 'console_scripts', 'flake8')()
File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 484, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
return ep.load()
File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2332, in load
return self.resolve()
File "/home/srdjan/.local/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2338, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/home/srdjan/anaconda3/lib/python3.7/site-packages/flake8/main/cli.py", line 2, in <module>
from typing import List, Optional
File "/home/srdjan/anaconda3/lib/python3.7/site-packages/typing.py", line 1347, in <module>
class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
File "/home/srdjan/anaconda3/lib/python3.7/site-packages/typing.py", line 1003, in __new__
self._abc_registry = extra._abc_registry
AttributeError: type object 'Callable' has no attribute '_abc_registry
Strangely enough, I was having somewhat similar problems when I was using SublimeLinter-pycodestyle and SublimeLinter-pyflakes, where pyflakes would keep throwing these weird error messages. I was never able to get it to work.
Should I perhaps uninstall pycodestyle and pyflakes from my laptop, now that I have flake8 and its accompanying SublimeLinter-flake8 plugin?
Related
I properly installed pbixrefresher from https://github.com/dubravcik/pbixrefresher-python
I get modulenotfound with pbixrefresher.pbixrefresher. Pbixrefresher.exe is installed. I've tried to troubleshoot and research a solution but cannot figure this out. Any help is appreciated!!
Traceback (most recent call last):
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\Scripts\pbixrefresher-script.py", line 11, in <module>
load_entry_point('pbixrefresher==0.1.8', 'console_scripts', 'pbixrefresher')()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 2862, in load_entry_point
return ep.load()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 2462, in load
return self.resolve()
File "C:\Users\xxxxxx\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 2468, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'pbixrefresher.pbixrefresher'
New versions of module(since November 2019) doesn't work correctly. Try to use version older November 2019 using a suitable python version, it should work.
I just installed Python 2.7.5 on my Windows 10 machine and I also got pip installed through setuptools. However whenever I try to install something using pip e.g. pip install numpy, I get this error message:
Traceback (most recent call last):
File "C:\Python27\Scripts\pip-script.py", line 8, in <module>
load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 318, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2221, in load_entry_point
return ep.load()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 1954, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "C:\Python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "C:\Python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\utils\__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "C:\Python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\pkg_resources\__init__.py", line 73, in <module>
__import__('pip._vendor.packaging.specifiers')
File "C:\Python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\packaging\specifiers.py", line 275, in <module>
class Specifier(_IndividualSpecifier):
File "C:\Python27\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\packaging\specifiers.py", line 373, in Specifier
r"^\s*" + _regex_str + r"\s*$", re.VERBOSE | re.IGNORECASE)
File "C:\Python27\Lib\re.py", line 190, in compile
return _compile(pattern, flags)
File "C:\Python27\Lib\re.py", line 242, in _compile
raise error, v # invalid expression
sre_constants.error: nothing to repeat
Since I'm pretty new to Python, I don't really understand what this error means. Any workaround?
I had a similar issue with a library that is using regular expressions (with the re.compile() function). I solved this issue installing the last version available 2.7.13 (I run a Windows 7).
Before I had the 2.7.6 version. I updated it installing the new version with the .msi installer, available in the Python web page.
I am trying to get Fab up and running locally. Why is Fab installing to /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5? The system Python version is 2.7.10, confirmed below:
Toms-MBP:~ tom$ which python
/usr/local/bin/python
Toms-MBP:~ tom$ python --version
Python 2.7.10
Toms-MBP:~ tom$ head -1 `which fab`
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5
Toms-MBP:~ tom$ fab
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/bin/fab", line 9, in <module>
load_entry_point('Fabric==1.11.1', 'console_scripts', 'fab')()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/fabric/main.py", line 13, in <module>
from operator import isMappingType
ImportError: cannot import name 'isMappingType'
you need this:
pip install fabric3
Its look like you aren't using a virtualenv configured previously, so I think that the system just uses the normal path to python which means to /Library/Frameworks/Python.framework/Versions/3.5/bin/python3.5 .
This error is usual when we try use Fabric with python3.x because Fabric has not been update to this version of python which is really sad.
When I run the command scrapy startproject tutorial, i get lots of lines of errors and at the end AttributeError:'NoneType'object has no attribute 'startswith'. In the previous lines it is pointing to various lines in various files
c:\Python27>scrapy startproject tutorial
Traceback(most recent call last):
File "C:\Python32\Scripts\scrapy-script.py", line 9, in <module>
load_entry_point('Scrapy==0.24.4', 'console_scripts', 'scrapy')()
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py", line 519, in load_entry_point
return get_distribution(dist).load_entry_point(group,name)
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py", line 2630, in load_entry_point
return ep.load()
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py", line 2310, in load
return self.resolve()
File "C:\Python32\lib\site-packages\pkg_resources\__init__.py",line 2316, in resolve
module=__import__(self.module_name, fromlist=['__name__'], level=0)
File "C:\Python32\lib\site-packages\scrapy\__init__.py", line 10, in <module>
__version__=pkgutil.get_data(__package__, 'VERSION').decode('ascii').strip()
File "C:\Python32\lin\pkgutil.py", line 565, in get_data
loader=get_loader(package)
File "C:\Python32\lib\pkgutil.py", line 453, in get_loader
return find_loader(fullname)
File "C:\Python32\lib\pkgutil.py", line 463, in find_loader
for importer in iter_importers(fullname):
File "C:\Python32\lib\pkgutil.py", line 413, in iter_importers
if fullname.startswith('.'):
AttributeError: 'NoneType'object has no attribute 'startswith'
Scrapy does not support Python 3:
What Python versions does Scrapy support? Scrapy is supported under
Python 2.7 only. Python 2.6 support was dropped starting at Scrapy
0.20.
Does Scrapy work with Python 3? No, but there are plans to support
Python 3.3+. At the moment, Scrapy works with Python 2.7.
You need to use Python 2.7.
I am having some trouble with LPTHW on Exercise 46 in which we create a skeleton directory for a future project and install pip among other things. I have having a problem with nosetests. Whenever I run it I get a problem. I have everything set up as he wants me to.
Here is the problem (I am running Ubuntu 12.04)
Traceback (most recent call last):
File "/usr/local/bin/nosetests", line 9, in <module>
load_entry_point('nose==1.3.0', 'console_scripts', 'nosetests')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 337, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2279, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1989, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/local/lib/python2.7/dist-packages/nose/__init__.py", line 1, in <module>
from nose.core import collector, main, run, run_exit, runmodule
File "/usr/local/lib/python2.7/dist-packages/nose/core.py", line 11, in <module>
from nose.config import Config, all_config_files
File "/usr/local/lib/python2.7/dist-packages/nose/config.py", line 9, in <module>
from nose.plugins.manager import NoPlugins
File "/usr/local/lib/python2.7/dist-packages/nose/plugins/__init__.py", line 184, in <module>
from nose.plugins.base import Plugin
EOFError: EOF read where object expected
I figured it out. When I installed Nose the first time, I didn't 'sudo' it and it never installed. And I cicked out of terminal before I saw it. At least. that's what I thought happened. I deleted nose and reinstalled it and now it works.
Suddenly get the same error. I fix this by removing --with-id from the argument.
I used it previously.
It works now.