I have a problem installing netfilterqueue for Python. I have this logs.
I am using Windows 10, not Linux, and Python 3.10
I've supplied both a short answer, and a longer explanation of it.
Short Answer
Unfortunately, the project seems to be abandoned after it only working with Python2. As a result, many people decided to downgrade to python2 to continue using it. However, forking a repo on GitHub fixed it for a while. However, the original person decided to stop updating it on GitHub.
Oremanj decided to take over maintainership of the project and keep it from going under. So, to install the fork that seems to work you would run this in terminal:
pip install cython
git clone https://github.com/oremanj/python-netfilterqueue
cd python-netfilterqueue
pip install .
Long Answer
There seems to be a lot of issues with getting it to work with python3 + scapy has the same issue with py3.
It seems like it works with python2. However, I am only referencing a thread that I found on the topic.
Referenced Here
However, I dug more into the topic and the issue and it seems like on the website it states that it works for python 3.6 and above.
It seems like it was abandoned: Referenced here:
I am mainly focusing on Cukic0d's answer to this question:
The project is abandoned but there are forks that fix this issue. https://github.com/kti/python-netfilterqueue/pull/60 especially upgrades netfilterqueue to build on modern Cython, allowing it to support Python > 3.6. You can try using that branch.
However, even looking at the GitHub it seemed like it was also abandoned. HOWEVER, it looks like oremanj on GitHub took over maintainership of the project: Referenced Here.
I've taken over maintainership of this project and just pushed an update. Will release to PyPI shortly; in the meantime you can pip install Git+https://github.com/oremanj/python-netfilterqueue.
I've never used netfilterqueue before. However, this is just some digging I did to hopefully get you a solution to this problem. If it still does not work let me know, and I'll dig further into what may be causing the issue.
Other solutions if it does not work I've referenced:
Microsoft Visual C++ 14.0 or greater is required, and you must install build visual tools 15, 17, 19 or greater. Download Here (This seems to not work for a lot of people, but it's worth a try) -- Referenced Here
Some people faced the same problem running the installation of it like this:
python -m pip install package-name
After many failed attempts, Lucas found that running it like this solved the issue:
py -m pip install package-name
He says that he gets two different python's one that is 3.9.8 and one that is 3.8.2: Referenced Here
Related
We have a fleet of networked machines with packages installed via pip install, normally pip install -r requirements.txt. We regularly find that a package is incorrectly installed, often in the cache directories too. Typical problems are zero length files.
I would expect that the problem here is out-of-disk, but some of the machines in question have never been low on disk.
What I do know is that we have previously had programmers who need to be educated to check the return codes of Linux utilities - maybe they didn't?
My question is this, to the knowledgeable: can I expect pip always to report failures such as these (and others), and will it do so via its exit code?
Supplementary question: if pip cannot be relied upon as above, is there a reasonably foolproof way to check that library modules have installed properly?
If I understood correctly for each project installed by pip there should be a *.dist-info/RECORD file containing the names of the files that should have been installed along with their hash and size in bytes. This info can be used to double-check that the installation went well.
I doubt it would really help in your case, but at another level (download) maybe have a look at pip's "Hash-Checking Mode" as well as pip's documentation section on "Ensuring Repeatability".
Otherwise I would suggest simply running a test suite against the installed projects to check for sanity.
Update (2020-03-05)
PEP 458 might help in the future.
I ran into the same problem as here. So I tried to install python developer package but I didn't find the way to do this.
Cython's helloworld instruction doesn't contain any info about it, which seems strange and stupid to me to not include basic requirements into instruction, named "Basic Tutorial" (Sorry if I don't get something about it.)
Anyway... I'm using Windows 10, PyCharm, virtual environment with python 3. When I went to package install window, search result contained 5 packages:
So, which one?
I tried to install one, but it gives me an error:
I met this error in the past with some other package already. PyCharm's suggestion is to run that command from terminal. But from my experience that never helped. Usually solution was either to change name (because some names are right for Python 2.x, other for Python 3.x), or to download the package (egg/wheel) manually and install it offline.
This question was asked before already, but that one is for linux, which is not the case for me.
Can someone save some time for me and future generations, please? ;)
How do I install it and make Cython's helloworld example work?
It seems that when I install Anaconda, I can't neither normal python or the python provided with Anaconda, even though Anaconda already in path.
I do realize that Anaconda also come with a python, but it come both with 2.7 and 3.2, but it's kinda scary due to the path conflict that I had earlier. It may ended like this, fortunately it goes normal when I uninstalled it
After uninstalling, my plan is to only take the installed library then uninstall Anaconda:
Reinstall Anaconda
Copy the library (scipy,numpy,etc)
Paste it to normal Python2
Uninstall Anaconda and its family
Hapilly ever after
But this seems not foolproof, is there any better way?
Note: As I mentioned, I know Anaconda have python avaliable too, so my other alternative is to uninstall normal python and just use Anaconda. But again, when I saw they provided two version, I decided to take the way mentioned above.
Python is getting more complex and installing libraries in a way that they work is becoming more brittle. You can install pip which will try to download the source code for libraries and compile them for your OS (which might or might not need a C compiler locally installed and working).
Anaconda tries to solve this hazzle by providing a set of working, well maintained libraries which you can install easily using the conda tool. When I installed the product last time, it didn't try to install both Python 2 and 3 - you have to select either. It also asks whether it should add itself to your path; you can say "no".
But you have to chose between: "I know exactly what I'm doing" - then you're on your own. Or you can say "I don't know enough" and trust some unknown expert to get it right most of the time.
You copy&paste approach might work since I haven't seen a Python library where absolute paths were compiled in. On the other hand, some of those libraries have hundreds of thousands of lines of code. It's hard to say which one of them will break when you start moving things around.
I have worked many hours over several days trying to get MySQL working with Mac OS X, Python (I've tried both 2.7 and 3.3), and Django 1.6.
This topic is addressed on many webpages, both in SO and elsewhere, and over a period of many years (one solution specifically uses MySQLdb 1.2.2, which was last modified in March 2007). Some of the posts seem to say they have it working, but when I try their solution, it doesn't work for me. On the other hand, one post from a few months ago flatly says it can't be done.
The heart of the problem seems to be installing a driver (whether MySQLdb or mysql-connector), and symptoms vary depending on which instructions you follow. Typical show-stoppers from the various attempted solutions have been "No module named 'MySQLdb'" and "Symbol not found: _mysql_affected_rows" when you finally try "python manage.py syncdb".
One wonders whether the very act of trying so many solutions has itself messed up my dev environment so that what would have worked with a clean slate won't work now. Yes, I've tried this both with and without virtualenv. I don't know whether virtualenv has gotten me closer or not, because I don't know how to recognize getting closer.
I happen to have OS X 10.7.5 (Lion) and MySQL 5.0 on my machine. Those are not the latest versions of either, but I don't know whether that matters and I'm reluctant to keep changing things. They work fine for other MySQL applications on my machine. I'll gladly upgrade either or both if a solution is available for later versions.
Does anyone actually have the configuration listed as the title of this post working, with either Python 2.7 or 3.3? If so, I'd be most grateful if you'd direct me to the solution.
UPDATE
I just wanted to let readers know that I eventually did get my app running with Python 3.3, Django 1.6, and sort-of MySQL. My app has been running smoothly for months.
I'm sorry, I don't have the time to recreate the many hours of steps and mis-steps I followed to get this working. I'll just outline the key points:
I started using Macs more than a decade ago, starting with PowerBooks, so my Mac has a lot of old stuff on it. The first thing I finally decided I had to do was to get rid of every copy of Python and Django; installers such as MacPorts and Fink; and any of the directories they like to put their installations into. Google was of course invaluable to me in learning how to do this, and all the other steps mentioned below.
I then started fresh (as much as I could give my Mac a fresh start) using Homebrew as my only command-line installer.
I also used virtualenv. I don't actually understand virtualenv very well, and again don't have the time to research it, but I've got it working and it does seem to be a good idea.
Well, within virtualenv, I also used pip, which I guess is also a command-line installer, but it seems to be part of the Homebrew/virtualenv methodology. Sorry I can't provide any expertise on this.
As I mentioned, the app sort-of worked with MySQL, but when I used Homebrew to uninstall MySQL, and install MariaDB instead, it started to work really well. As far as I can tell, Django, Sequel Pro, PyCharm's DB features, and other programs that think they're talking to MySQL can't tell the difference between MySQL and MariaDB. I also really like the MariaDB online documentation. Admittedly, "MariaDB" isn't a great name, but neither is "MySQL".
Bottom line: If someone tells you it's impossible to get Python3.3 and Django1.6 running with MySQL (or at least MariaDB) on a Mac, don't believe them. It can be done, it's just hard to do if your system has a lot of legacy files and apps that can get into conflict with what you're trying to do.
One more thing: When I started work on this project, I suspended my work on a GAE app I'd been making great progress on for over a year. Since I'll be going back to that project soon, I wanted to keep my GAE install up-to-date on my machine, but sadly, I can no longer run the GAE installer for updates. I get some error about not being able to find python2.5. Sigh. That's what I'll have to look forward to solving when I get back to working on that project.
You could try using the pure-python pymysql:
sudo easy_install pymysql
(Use pip if you have it installed.) Then, add this before execute_from_command_line in manage.py:
try:
import pymysql
pymysql.install_as_MySQLdb()
except ImportError:
pass
I feel your struggle. I went through the same thing and found the setup process very frustrating. I don't really know which instructions you follow on which website that is throwing exceptions. But I find that all these instructions are missing either one or two small prerequisites. For example, xcode and command-line tools needed to be installed before doing any pip install. For the connectors, if you are using mysql-python, you probably need to install python-devel. I used this instruction. You are probably right that with so many installation attempts your system is probably corrupt and you might need to re-install your osx and start clean, again. It's painful, but that's what I had to do to make it work. I hope your next attempt works.
I've found this link and it seems a bit out of date. So I'm hoping someone else has had this same problem.
I'm trying to install P4Python using these instructions.
After running the setup.py script, when I try to run p4test.py as the instructions request, I fail all but 4 tests.
I've downloaded the 10.2/bin.macosx105u p4api, I have gcc 4.2.1, and Python 2.6.1
I'm sure I've left out an important piece of information, so please just let me know what else is needed and I'll edit this post.
Edit: A note for any one else looking at this, I wasn't able to get the bin.macosx105u version of P4Api to compile correctly. Everything did work however when I used the bin.darwin90u version.
Do you have the p4d executable on your machine? See the Note in step 4 of the installation instructions. If p4d isn't there, it's quite possible that a lot of tests fail.
If you indeed don't have it (and don't want to or can't install it), then go ahead and continue with the installation and see if the P4API works.