Slow Scapy start up - scapy

Lately I installed Scapy for python 2.7, and every time I try to start it (Whether through python27/Scripts and whether using from scapy.all import *) it takes about 30 seconds or so to start up. I installed the latest dnet, winpcap, pyreadline and pypcap. Does anyone have any idea why it happens?

As of 2.4.3rc+, Scapy boot time on Windows has been drastically reduced (now using C calls to query Windows): try it out using pip install --pre scapy
Late answer,
First, you can get the latest Scapy version of the GitHub repo, which do not require any other packages than pyreadline. That might improve the loading speed.
Scapy on windows take way more time to load because of the powershell calls that are slow.

Related

TrainDeepLearningModel tool not responding in arcgis pro

Platform: Precision 5820, 32G, rtx4000; Win 10 Pro, Arcgis Pro 2.6 concurrent license;
Issue:
I installed the deep learning tools following the guidelines provided here:
deeplearninginstallation
tersorflow was not found after installation so I manually installed the 2.1.0 version. I now have arcgis 1.8.2, pro 2.6, fastai 1.0.60, python 3.6.12, pytorch 1.4.0, tensorflow-gpu 2.1.0; environment check in arcgis pro python seemed fine.
However, after I select toolbox-image analyst-deeplearning-traindeeplearningmodel, the program seems to go into a hang, with most buttons disabled/unresponsive, this would continue until I force terminate the program. I also ran into "tool not licensed" twice, which was gone after I restarted the program; and a "name 'CallBackHandler' is not defined" once, which was also gone after I restarted.
I tried runing the command from the arcgis pro python prompt:
TrainDeepLearningModel(r"**", r"**", 40, "RETINANET", 16, "# #", None, "RESNET50", None, 10, "STOP_TRAINING", "FREEZE_MODEL")
executing the command would also send the program into a hang similar to the previous one. Monitor shows that ram and GPU usage haven't changed much, so I left the program running for an hour before forcibly terminating it.
I'd greatly appreciate it if anyone can tell me what the issues are here. I'll post any other env parameters if anyone requires. Cheers.
I got the tool up and running now by running conda install -c pytorch -c fastai fastai=1.0.54 pytorch=1.1.0 torchvision scikit-image and removing all the conflicting specifications in the cloned arcgispro-py3 env that I had. Now I still don't understand what went wrong. Presumably one or more packages in the env was conflicting. But seeing as I'm not a python expert, I couldn't identify the exact issue.
Before this I tried the versions stated here deeplearning install guide, but wasn't able to get pass tensorflow-gpu because python kept checking conflications. Now I actually don't have tensorflow-gpu in the env. I have tensorflow 2.1.0, keras-applications 1.0.8/base 2.3.1/preprocesing 1.1.0 (no keras-gpu), scikit-image 0.17.2, pillow 6.2.1, fastai 1.0.54, pytorch 1.1.0, libtiff 4.0.10. Some are different from what the guideline provided.
Thing is when I ran the process, CPU usage was up and GPU wasn't despite the fact that I specified GPU as the processing core. But I have much more pressing things to do right now like getting the analysis finished. So I'll probably tweek the env around a little after I'm done with this bit and see what happens. Meanwhile, anyone's input is still welcome.

RHEL 7.6 - Built Python3.6 from Source Broke Network

I have a RHEL system which by default was running Python2.7 and Python3.4
I needed Python3.6 for a project I wanted to work on and so I downloaded it and built it from source. I ran make and make install which hindsight may have been the wrong decision.
Now I do not seem to have any internet connectivity. Does anyone know what I may have over written to cause this or at least where specifically I can look to track this issue down?
Note: I can Putty into the Linux machine but it doesn't seem to have any other connectivity, specifically HTTPS
It's a bit weird that this would break network connectivity. One possible explanation is that the system has networking scripts or a network manager that relies on Python, and it got broken after make install replaced your default Python installation. It may be possible to fix this by reinstalling your RHEL Python packages (sorry, cannot offer more detailed help there, as I don't have access to a RHEL box).
I guess the lesson is "be careful about running make install as superuser". To easily install and manage different Python versions (separate from the system Python), the Anaconda Python distribution would be a good solution.
I suggest to undo that 3.6 installation and use the Software Collections version of python 3.6. See here for python 3.6 installation. Software Collections install "along side" the original versions so as to not affect the OS - and they are included in the subscription.
So after a lot of time slamming my head against the wall I got it worked out. My best guess is that the system (RHEL 7) relied on something from its default Python2.7 installation to handle SSL negotiations. Installing 3.6 alongside must have overwritten some pointer. Had I done this correctly, with altinstall all would have likely been fine.
The most frustrating part of this is that there were no error messages, connections just timed out.
To fix this, I had to uninstall all Python versions and then reinstalled Python2.7 - Once Python2 was back in the system it all seemed to work well.

How do I connect Vertica to Python on MAC OS?Will I need Unix or Linux Scripting?

I am new to MAC OS , I need to know how do I connect Vertica to Python on MAC OS .
I need to know detailed steps for configuration .
The Vertica Python client vertica-db-client is no longer actively being developed by Vertica. It will continue to be supported until the Python2 end of life in 2020, but it is not worth using as it is underdeveloped and going away soon.
In August of 2018 Vertica took over development of vertica_python a python client originally developed by Uber. This is the recommended way to connect to Vertica using python. I have used vertica_python for years (well before Vertica took over development), and even back then it was—in my opinion—the best python client for Vertica. And since Vertica took over development it has continued to improve significantly.
The source code can be found on GitHub: https://github.com/vertica/vertica-python
The documentation for this client can also be found on GitHub: https://github.com/vertica/vertica-python/blob/master/README.md
To install you can use pip for either python2 or python3
$ pip install vertica_python
or
$ pip3 install vertica_python
Refer to the documentation for a full list of prerequisites and installation instructions.

Can I update Python 3.5 without downloading and installing entire new version, eg, 3.5.2?

It seems overkill to download and install 3.5.2 from https://www.python.org/downloads/mac-osx/ to simply updgrade from 3.5.0. Is there a Python command that will update itself?
Mac OS 10.11.6
Python 3.5.0
First question: do you need to upgrade?
See the change log. There are no new features introduced in 3.5.2 just various bug fixes. If you are not affected then your time may be better spent elsewhere.
If you do still want to upgrade there is probably no easier way than downloading an upgrade and installing it. Even if you use python to upgrade itself, it would still need to download the same files. There would be no real saving in time.

IPython notebook connection failed issue

This is probably very simple; and I am embarrassed to ask; but I spent a long time trying to solve it already. I am trying to use an IPython notebook and on the click to get a Python 3 notebook, I often (but not always) get:
Connection failed
A connection to the notebook server could not be established. The notebook will continue trying to connect, but until it does, you will NOT be able to run code. Check your network connection or notebook server connection."
The obvious answer might appear that I have no internet connection; but I can access the internet and interact with external websites. It seems to be a problem of connecting with something local to my computer.
The really frustrating part is that sometimes in the past this has worked with no problem. That suggests to me that it is a simple setting issue. Does anyone have suggestions about how I can debug this?
My operating system is Windows (both 7, and 8.1). I am also using Anaconda 2.3 and Python 3.4
Downgrade Tornado to 5.1.1 from 6.0, that will solve it.
Apparently, Tornado 6.0 breaks notebook.
I anwser a similar question. And I agree with tchakravarty.
Maybe resulting from your proxy?I have been troubled for one afternoon for that,because I use nginx proxy_pass fo my jupyter to proxy to that port. But it always didn't connect, i look through the docs of jupyter notebook and found that Jupter Proxy Issue
And i change to use nginx rewrite rather than proxy, it works. So in my case, it can be caused by proxy.
I was also facing the same problem and as the few people suggested to update the tornado version , I did but it din't help.
What helped me was ---
I ran this two following commands -
python2 -m pip install --upgrade ipykernel
python2 -m ipykernel install
In Jupyter Notebooks, the kernel is responsible for executing Python code. When you install the Anaconda System for Python3, this version also becomes the default for the notebooks. In order to enable Python 2.7 in your notebooks, you need to install a new kernel.

Resources