[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-23 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Closing as not-a-bug. Feel free to reopen if we've missed anything.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-18 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Eryk, Steve, can we close this? AFAICT, this belongs to a user forum.

Shreyan: it seems like a bpo bug to me. I have a feeling closing the issue will 
help.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-18 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Are you kidding me, What's going wrong with this issue tracker? I sent a 
message and it's set to open now? I'm not even a core dev or triager. What the 
heck is going on?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-18 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

I've noticed whenever a core dev or triager sends a message the status is 
automatically set to open. But that's a different glitch or issue.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-18 Thread Erlend E. Aasland


Erlend E. Aasland  added the comment:

Setting status to pending again. (Seems like bpo likes this dance)

--
nosy: +erlendaasland
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-17 Thread Eryk Sun


Eryk Sun  added the comment:

> There are a few ways to get multiple Python installs that 
> could lead to launching the wrong one through PATH. 
> --user is one of the least likely.

As far as I was aware, a --user installation prior to Python 3.10 would be the 
common way to have the wrong version of a pip-installed extension module in 
sys.path. (This is fixed in 3.10.) Another way is if PYTHONPATH mistakenly 
includes another installation's site-packages.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-17 Thread Steve Dower


Steve Dower  added the comment:

I didn't mean to change it. Maybe bpo did it automatically?

There are a few ways to get multiple Python installs that could lead to 
launching the wrong one through PATH. --user is one of the least likely.

--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-17 Thread Eryk Sun


Eryk Sun  added the comment:

> For this issue, the PATH conflict would be that "pip" and "python" 
> refer to different Python installs.

I'm aware of the problem for a per-user installation prior to 3.10. However, 
none of the install commands use the "--user" option, else I would have 
suggested it. That said, it wouldn't surprise me that I overlooked something, 
or multiple things, since packaging is my weakest area.

> Visual Studio Developer Console, which overrides pip's platform 
> detection making it think that it's a 32-bit runtime

Why did you change the issue status back to "open"? By marking it as pending, I 
was trying to encourage getting help on forums first. If the "more likely" 
explanation that you suggest is the case, then the problem likely would have 
been recognized in forums, or probably referred to pip's issue tracker. The 
first impulse shouldn't be to create an issue on CPython's issue tracker to 
"solve this problem" for a configuration or coding problem that can't be 
resolved on one's own. I see novices doing this occasionally because they 
aren't aware yet of the other support channels that are available to them.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-17 Thread Steve Dower


Steve Dower  added the comment:

>> Usually this error occurs due to PATH conflicts. 
>
> Python 3.8 and above does not use PATH when importing extension modules

For this issue, the PATH conflict would be that "pip" and "python" refer to 
different Python installs.

However, this one is more likely because it was run in the Visual Studio 
Developer Console, which overrides pip's platform detection making it think 
that it's a 32-bit runtime. The fix is slowly making its way through the 
various third-party projects that needed to be fixed, so soon the answer will 
be "python -m pip install --upgrade pip".

Until then, you can either run Python using a regular command prompt/PowerShell 
prompt, or you can use Visual Studio's x64 command prompt instead.

--
status: pending -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-16 Thread Eryk Sun


Eryk Sun  added the comment:

The issue tracker is not a general support forum for software development. 
Please ask first on python-list or the users group on discuss.python.org. For 
now, I'm changing the status of this issue to pending. If the discussion 
determines that there's a bug in Python that needs to be fixed, please return 
with the relevant information and example code to reproduce the problem.

> Usually this error occurs due to PATH conflicts. 

Python 3.8 and above does not use PATH when importing extension modules, nor by 
default with ctypes CDLL and WinDLL. See os.add_dll_directory(). Note that 
commonly the latter isn't needed because the directory of the loaded PYD/DLL is 
implicitly searched.

--
nosy: +eryksun
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-16 Thread Shreyan Avigyan


Shreyan Avigyan  added the comment:

Can you provide the full traceback log of at least one of the import failures. 
Try importing matplotlib, for example, and extract the traceback log. Usually 
this error occurs due to PATH conflicts. This issue is thoroughly discussed in 
https://github.com/pytorch/pytorch/issues/27693. You may find a answer there. 
If your problem still persists then please provide the full traceback here to 
help everyone further debug your issue.

--
nosy: +shreyanavigyan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue44147] [WinError 193] %1 is not a valid Win32 application

2021-05-16 Thread Bassel


New submission from Bassel :

I'm trying to import these libraries in python using this code:

import matplotlib as plt
from matplotlib import style
import pandas as pd
import pandas_datareader.data as web
I get unresolved import for each line. I installed them using the terminal of 
Visual Studio using the following commands

pip install matplotlib
pip install pandas
pip install numpy
pip install sklearn
pip install pandas-datareader
pip install beautifulsoup4
What should I do to solve this problem? Please consider that I'm kind of a 
beginner so make your answer detailed. Thanks!

--
components: Windows
messages: 393739
nosy: bassel27, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [WinError 193] %1 is not a valid Win32 application
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com