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?
Related
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
I don't have much experience with Python. Don't judge me for that. I just beg you to tell me how to take use of VPython. I already have Python installed on Mac. Version 3.9.8. At least I believe to know. It's something called IDLE Shell. Apparently I can run normal Python code there. But I didn't found any source telling me how to access on packages like VPython. Is it possible at all in the shell? Tutorials where that package is used I only see on online editors like Trinket or GlowScript itself. Normally access is granted by typing
GlowScript 2.6 VPython and afterwards the specific code follows. However in the shell it gives error invalid syntax. So does another trick exists?
Edit I have installed VPython via Terminal: pip install VPython.
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 1 year ago.
Improve this question
been trying to do this for the last 3 hours with NO SUCESS at all.
I want to install Python modules in VS Code on a MAC BOOK PRO.
I enter the command pip3 install matplotlib or pip3 install keyboard AND NOTHING WORKS. This seems like the worst IDE on the planet. I keep getting the message in the terminal window of No module named 'matplotlib' when I clearly HAVE downloaded it. I'm enclosing a screen shot here.
ALSO - I Do NOT want to run in a virtual environment. I want to use the modules in any program I run. I cannot program without getting round this issue so any help would be greatly appreciated ! I am very new to Python in VS code.
Python works pretty bad for beginners IMHO, especially when people usually have no idea that both Python 2 and 3 are there (and even more minor versions on the same machines for whatever reasons).
Learn the python version being used
For your current folder opened in VSCode, 3.8.2 64 bit is used and shown in the status bar, so click it and check the popup list at top to learn what are the Python executable paths available on this machine.
You should choose /usr/bin/python3 from the list, as that's usually the default many people is using right now.
After that configuration, VSCode sticks to that executable to locate all modules and so on.
Install modules
As now you know the path of Python executable, installing a module are simply,
/usr/bin/python3 -m pip install some.module
Calling pip in this way avoid all the mess with other approaches (as they can simply install the module for another Python executable under your nose).
This should be enough to get you started on your Python journey, but far from enough to make sure you can write scripts and debug them.
Ideally, find a teacher/mentor or just someone with more Python experience than you to guide you through. Then you don't need to waste time on the tiny little things.
Managing Python versions has become somewhat of a quagmire (and some would say that's generous).
In the same way that your system will search through the folders in $PATH looking for binaries, python will search through the folders in $PYTHON_PATH looking for modules.
So you need to know:
where does pip3 install your modules?
is that in echo $PYTHON_PATH?
More info here:
https://stackoverflow.com/a/65164141/10761353
https://stackoverflow.com/a/53566561/10761353
Failing that, pyenv is a tool that help manage multiple python versions in a system (I just started dabbling with this last night myself). Basically you would do something like:
install pyenv
use pyenv to (e.g.) pyenv install 3.9.6
define your global python versions pyenv global 3.9.6
One can install pyenv from Homebrew: https://github.com/pyenv/pyenv#homebrew-on-macos
Try running which python3 in the terminal. In mac the default python is installed in /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.
So if you install package with pip3 it will be installed in Location: /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-package. And according to your posted image you are running your program with /usr/bin/python3 which is unable to find the installed packages.
I'm a python noob working through this intro to python: https://www.youtube.com/watch?v=rfscVS0vtbw. (definitely no need to watch this. Just adding it as context)
It's been going really well, except now I'm up to the part where I need to use pip, and despite having downloaded version 3.8 of Python, it keeps telling me that it doesn't even have pip installed.
I'm wondering if anyone could walk me through what the issue might be and how to actually start using pip in PyCharm.
I've tried downloading pip and installing it but even that doesn't seem to work. If anyone has an ultra-hand-holdy solution (very much for a noob) that would be appreciated.
I feel like the problem might be that I'm putting things in the wrong directories or something? Obviously there are some built-in versions on Python (2.x) already on the Mac so maybe they are interfering?
Thanks in advance for your help.
If I recall correctly, the version of Python that is used when you use the command python is the 2.x version, which doesn't have pip. So if you want to use python in terminal, you should call it as python3 and pip3 for using the pip command.
If you want to set a different Python version as the default one, you can do that. Here is a tutorial that can get you started with that (there's a plethora of other tutorials if this one isn't clear enough): https://opensource.com/article/19/5/python-3-default-mac
For using PyCharm specifically, you can setup the Python interpreter that is used with PyCharm by going to Preferences(or Settings) -> Project:[name of your project] -> Project Interpreter and then chose the desired Python Interpreter from the drop down menu. You can also create a virtual environment there by clicking on the cog icon and choosing Add. This is the preferred way and very convenient to keep installed packages local to your project. After you're done with that, open up PyCharms terminal (at the bottom of your PyCharm window) and you should be able to normally use pip with the command pip.
Alternatively, you can install Python packages in PyCharm using their built in package manager that you can find in the same window where you set your Python Interpreter. Below the dropdown menu you'll see a + sign, where you can click to add packages.
In this SO post I outlined my problems, and I would like to try and solve them by getting rid of all my downloaded python launchers, modules, versions, pip etc (for python 2 & 3) and start afresh. My only problem is that macOS comes pre-loaded with python 2 and I don't think I can or should get rid of that, but I do have other versions of python 2 installed that I do want to delete.
Is there any help that you can offer that will tell me what to delete and what not to?
Should I need to use 'sudo' at all during my uninstalling?
Are there any tests to ensure certain things are completely gone?
Please keep answers fairly simple to understand implement.
When I reinstall the things I need, is it better to do it all via home-brew, then pip; instead of downloading from safari, unless necessary?
If you installed using sudo (or typed your password into an installer), you'll need this to uninstall too. Mac python is in /usr/bin/python and /usr/lib/python*. Yes it can be good to install via homebrew, although I've had good success with the Anaconda distro of Python. The important thing is setting you PATH and PYTHONPATH variables in ~/.profile or ~/.bash_profile so that it sees your custom installed Python before it sees the system install.