I have been trying to get sourcedefender (https://pypi.org/project/sourcedefender/) to work on a laptop running PiDesktop and and windows 7 machine both with the same issue. PiDesktop is running python 3.7 and the windows machine is running Python 3.8.
Both come back with
ImportError: cannot import name 'loader' from 'sourcedefender'
D:\Python Stuff>sourcedefender encrypt test_stuff.py
Traceback (most recent call last):
File "C:\Users\adam.hedley\AppData\Local\Programs\Python\Python38\Scripts\sourcedefender-script.py", line 11, in <module>
load_entry_point('sourcedefender==6.0.21', 'console_scripts', 'sourcedefender')()
File "C:\Users\adam.hedley\AppData\Local\Programs\Python\Python38\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\adam.hedley\AppData\Local\Programs\Python\Python38\lib\site-packages\pkg_resources\__init__.py", line 2862, in load_entry_point
return ep.load()
File "C:\Users\adam.hedley\AppData\Local\Programs\Python\Python38\lib\site-packages\pkg_resources\__init__.py", line 2462, in load
return self.resolve()
File "C:\Users\adam.hedley\AppData\Local\Programs\Python\Python38\lib\site-packages\pkg_resources\__init__.py", line 2468, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "<frozen zipimport>", line 259, in load_module
File "C:\Users\adam.hedley\AppData\Local\Programs\Python\Python38\lib\site-packages\sourcedefender-6.0.21-py3.8.egg\sourcedefender\__init__.py", lin
e 3, in <module>
ImportError: cannot import name 'loader' from 'sourcedefender' (C:\Users\adam.hedley\AppData\Local\Programs\Python\Python38\lib\site-packages\sourcede
fender-6.0.21-py3.8.egg\sourcedefender\__init__.py)
Exactly the same result if I also try sourcedefender encrypt --ttl=1d test_stuff.py
I am hoping someone may have a simple solution.
Related
I recently installed python3 and I had tons of problems so decided to delete my wsl and reinstall everything since I didn't have important stuff there.
I installed python 3.10 and apparently pip but when I try to use pip to install something or just to use list I'm getting this:
Traceback (most recent call last):
File "/usr/bin/pip", line 11, in <module>
load_entry_point('pip==20.0.2', 'console_scripts', 'pip')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/usr/lib/python3/dist-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main_parser.py", line 7, in <module>
from pip._internal.cli import cmdoptions
File "/usr/lib/python3/dist-packages/pip/_internal/cli/cmdoptions.py", line 19, in <module>
from distutils.util import strtobool
ModuleNotFoundError: No module named 'distutils.util'
I'm not really sure how to fix it. I've tried a few things already
when I try to run certbot in my console on my Linux Ubuntu Server 20.04.3 LTS, I get following error:
Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in <module>
load_entry_point('certbot==0.40.0', 'console_scripts', 'certbot')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 18, in <module>
from certbot import cert_manager
File "/usr/lib/python3/dist-packages/certbot/cert_manager.py", line 15, in <module>
from certbot import ocsp
File "/usr/lib/python3/dist-packages/certbot/ocsp.py", line 25, in <module>
from certbot.storage import RenewableCert # pylint: disable=unused-import
File "/usr/lib/python3/dist-packages/certbot/storage.py", line 15, in <module>
from certbot import cli
File "/usr/lib/python3/dist-packages/certbot/cli.py", line 33, in <module>
from certbot.plugins import disco as plugins_disco
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 183, in <module>
class PluginsRegistry(collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'
I have already searched for a solution, but have not found one. Even posts that have the same error could not solve the problem for me. Strangely enough, it worked about two months ago.
I'm running Python 3.10.
In my case, I edited the file /usr/bin/certbot and changed #!/usr/bin/python3 to: #!/usr/bin/python3.8 because Certbot does not support Python 3.10 yet
Upon launching spyder 3.3.6, I receive the following error:
Traceback (most recent call last):
File "/usr/bin/spyder", line 11, in <module>
load_entry_point('spyder==3.3.6', 'gui_scripts', 'spyder3')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 473, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2447, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2453, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/spyder/app/start.py", line 14, in <module>
import zmq
File "/usr/lib/python3/dist-packages/zmq/__init__.py", line 55, in <module>
from zmq import backend
File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 40, in <module>
reraise(*exc_info)
File "/usr/lib/python3/dist-packages/zmq/utils/sixcerpt.py", line 34, in reraise
raise value
File "/usr/lib/python3/dist-packages/zmq/backend/__init__.py", line 27, in <module>
_ns = select_backend(first)
File "/usr/lib/python3/dist-packages/zmq/backend/select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "/usr/lib/python3/dist-packages/zmq/backend/cython/__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: cannot import name 'constants' from partially initialized module 'zmq.backend.cython' (most likely due to a circular import) (/usr/lib/python3/dist-packages/zmq/backend/cython/__init__.py)
Version of pyzmq is 20.0.0. Using pip, I've tried to update, uninstall-reinstall, and downgrade it to 19.0.2, but nothing helped. I'm using Debian testing, it's up to date.
Any ideas?
I can't get pip to work on OS X. I've tried everything I could find here, installing, removing, reinstalling python, etc. but nothing works. I keep getting the following error message:
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==8.1.1', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2394, in load_entry_point
return ep.load()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2108, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/Library/Python/2.7/site-packages/pip-8.1.1-py2.7.egg/pip/__init__.py", line 14, in <module>
from pip.utils import get_installed_distributions, get_prog
ImportError: No module named utils
Formerly I used googlecl, but it doesn1t work anymore due to authentication issues, google dropped OAuth1 support, or something. Then I tried EasyBlogger script to post blogposts from command line, but it proved very tricky: http://blog.rraghur.in/p/blog-page.html
I simply followed the steps on that page. First I had to install a package called Pandoc. It took about 3 weeks for me to finding out how to install it. Finally I managed to install it as a package pandoc-static for my Arch Linux box. Unfortunately easyblogger script still doesn't work, however I also installed a package called pypandoc from github:
When I run it with python2, I get error messages:
Traceback (most recent call last):
File "/usr/bin/easyblogger", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3074, in <module>
#_call_aside
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3060, in _call_aside
f(*args, **kwargs)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3087, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 645, in _build_master
ws.require(__requires__)
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 946, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 833, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pypandoc' distribution was not found and is required by EasyBlogger
When I run it with python3, I get different error messages:
Traceback (most recent call last):
File "/usr/bin/easyblogger", line 9, in <module>
load_entry_point('EasyBlogger==0.9.0', 'console_scripts', 'easyblogger')()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
return ep.load()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2355, in load
return self.resolve()
File "/usr/lib/python3.4/site-packages/pkg_resources/__init__.py", line 2361, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3.4/site-packages/EasyBlogger-0.9.0-py3.4.egg/blogger/__init__.py", line 1, in <module>
ImportError: cannot import name 'EasyBlogger'
I really need some blogger script, because all of my blogs are out of order now for about 2 months.