Setup-tools

Mats Wichmann mats at wichmann.us
Sun Jul 16 12:56:10 EDT 2023


On 7/15/23 12:56, MRAB via Python-list wrote:
> On 2023-07-15 07:12, YOUSEF EZZAT via Python-list wrote:
>> Hey!..... i face a problem when i get setup packages by pip
>> when i code this : "pip install numpy" in my command line it gives me 
>> error
>> "ModuleNotFoundError: No module named 'distutils'"
>>
>> please, i need help for solving this problem.........
>> i have python 3.12.0b4
> 
> What do you normally do when it can't find a module? Install it via pip!
> 
> pip install distutils
> 
> By the way, do you really need Python 3.12? It's still in beta, so 
> unless you're specifically checking whether it works, ready for its 
> final release, you'd be better off with Python 3.11.

To add to this:

For modules which have *binary* compiled wheels (of which numpy is one), 
they are quite likely to be version-specific, and for many projects, are 
not made available for pre-release Pythons. You can check numpy here:

https://pypi.org/project/numpy/#files

(note: pre-release versions targeting pre-release Pythons *may* be 
elsewhere too, you might check with the numpy project).

What pip does if it doesn't find an appropriate wheel version matching 
your Python version is try to build it from the source distribution - 
this is why it thinks it needs distutils.  If you're on Windows, this 
will almost certainly fail, although you can often find blogs written by 
people who have gone through the same adventure who describe how they 
got there in the end.

If numpy is the thing that's important to your work, the advice would be 
to stick to a released Python with a matching released numpy.  If you 
specifically need to test that something is going to work with 3.12, 
then by all means go ahead, but be prepared to do some legwork.





More information about the Python-list mailing list