Scapy errors with python2 [closed] - python

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 hours ago.
Improve this question
ERROR: Loading module scapy.layers.ipsec
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/scapy/main.py", line 156, in _load
mod = importlib.import_module(module)
File "/usr/lib/python2.7/importlib/init.py", line 37, in import_module
import(name)
File "/usr/local/lib/python2.7/dist-packages/scapy/layers/ipsec.py", line 519, in
from cryptography.utils import CryptographyDeprecationWarning
ImportError: cannot import name CryptographyDeprecationWarning
it gives me this error when using scapy with python2
testing python2 script

Related

Why does Dash throw a TypeError when debugging through PyCharm? [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 1 year ago.
Improve this question
When I try to run a Dash app from PyCharm in debug mode I keep getting the below TypeError. What can I do to fix this so that I can break on breakpoints in PyCharm?
I'm using: Dash 2.0.0, Python 3.9.6, PyCharm Community Edition 2021.1.3, Windows 10.
Connected to pydev debugger (build 212.4746.96)
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\pydevd.py", line 1483, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files (x86)\JetBrains\PyCharm Community Edition 2021.1.3\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/redacted/dashboard/dashboard.py", line 170, in <module>
_app = dash.Dash(__name__, external_stylesheets=[dbc.themes.DARKLY])
File "C:\redacted\.venv\lib\site-packages\dash\dash.py", line 304, in __init__
self.server = flask.Flask(name) if server else None
File "C:\redacted\.venv\lib\site-packages\flask\app.py", line 406, in __init__
instance_path = self.auto_find_instance_path()
File "C:\redacted\.venv\lib\site-packages\flask\app.py", line 638, in auto_find_instance_path
prefix, package_path = find_package(self.import_name)
File "C:\redacted\.venv\lib\site-packages\flask\scaffold.py", line 850, in find_package
package_path = _find_package_path(root_mod_name)
File "C:\redacted\.venv\lib\site-packages\flask\scaffold.py", line 801, in _find_package_path
return os.path.dirname(next(iter(spec.submodule_search_locations)))
TypeError: 'NoneType' object is not iterable
python-BaseException
Process finished with exit code 1
Here's how I've setup my PyCharm run configuration:
Likely a bug in PyCharm. Solved by upgrading PyCharm to 2021.2.3.

How can I get PySoundfile to run on Google Cloud Platform flexible environment? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I have a simple application that I'd like to deploy to a GAE standard or flexible environment, and it requires the generation of simple audio files.
I have code that runs well locally (on the dev server) using PySoundfile, but I run into errors with the underlying libsndfile when the application is deployed.
Traceback (most recent call last):
File "/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/env/local/lib/python2.7/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
__import__(module)
File "/home/vmagent/app/main.py", line 3, in <module>
import tonegen
File "/home/vmagent/app/tonegen.py", line 4, in <module>
import soundfile as sf
File "/env/local/lib/python2.7/site-packages/soundfile.py", line 267, in <module>
_snd = _ffi.dlopen('sndfile')
File "/env/local/lib/python2.7/site-packages/cffi/api.py", line 141, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "/env/local/lib/python2.7/site-packages/cffi/api.py", line 802, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "/env/local/lib/python2.7/site-packages/cffi/api.py", line 797, in _load_backend_lib
raise OSError(msg)
OSError: ctypes.util.find_library() did not manage to locate a library called 'sndfile'
I've also tried wave unsuccessfully.
In the flexible environment you could try to build and use a custom runtime in which you can add non-python dependencies, like OS libraries (libsndfile in your case and whatever else you may need).
Basically the same answer as in How oracle jdk can be configured in Google App Engine Flexible environment.

Django Error on Travis: RuntimeError: populate() isn't reentrant [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I am maintaining a project, with Travis CI implemented, and from one day. All my builds start failing without me touching anything or any dependence update ...
I guess that Travis changed something, I tried to investigate, but honestly I have no clue.
If I run a previous build which perfectly worked, now it fails with this everytime I call python manage.py ##whatever##
$ python manage.py collectstatic --noinput
Traceback (most recent call last):
File "manage.py", line 35, in <module>
execute_from_command_line(sys.argv)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/travis/virtualenv/python3.6.3/lib/python3.6/site-packages/django/apps/registry.py", line 81, in populate
raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant
By the way, I obtain the exact same error with Python 3.6 and 3.5.
$ python manage.py collectstatic --noinput
Traceback (most recent call last):
File "manage.py", line 35, in <module>
execute_from_command_line(sys.argv)
File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/core/management/__init__.py", line 357, in execute
django.setup()
File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/travis/virtualenv/python3.5.6/lib/python3.5/site-packages/django/apps/registry.py", line 81, in populate
raise RuntimeError("populate() isn't reentrant")
RuntimeError: populate() isn't reentrant
And naturally, this issue is impossible to reproduce on my own machine ... It's running just fine locally.
Additional Information:
If I take a former build which already passed without any issue:
Link: Travis Build #1336
And I decide to relaunch the build, as you can see the builds are now failing for an obscure reason...
Any idea how to solve this issue ?

I am using fabric python library using that I create the 50 times ssh connection I need it but I get following error [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
While using fabric library in python and forming ssh connection I am getting following error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
solve the issue by using connections in fabric python library .store all the ip in cache by default then at end of script disconnect from all remote machine by using disconnect_all() method.

Ghost.py - what does this stack trace mean? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
How do I go about debugging this stack trace?
Traceback (most recent call last):
File "<string>", line 73, in execInThread
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 196, in __call__
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 71, in syncreq
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 431, in sync_request
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 379, in serve
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 337, in _recv
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\channel.py", line 50, in recv
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\stream.py", line 166, in read
EOFError: [Errno 10054] An existing connection was forcibly closed by the remote host
The stack trace does not refer to a line in my code, which is too long to reproduce here. However, the key component other than the standard python library is Ghost.py.
Thanks!
This means the server closed the connection unexpectedly, usually because it crashed for some reason. In this case, it looks like the client is pyscripter and the server is a subprocess running your app, and it sounds like the subprocess crashed so hard that it did not gracefully close the connection or send back a meaningful traceback. So, either there is a bug in pyscripter or a bug in your code. My advice is to run your app without the IDE and see if you can reproduce the issue and get a meaningful traceback.

Categories