Mailing List Archive

Python Error
Dear Group,

I was trying to convert the list to a set, with the following code:

set1=set(list1)

the code was running fine, but all on a sudden started to give the following error,

set1=set(list1)
TypeError: unhashable type: 'list'

please let me know how may I resolve.

And sometimes some good running program gives error all on a sudden with no parameter changed, how may I debug it?

Thanking You in Advance,

Regards,
Subhabrata Banerjee.

--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
subhabangalore@gmail.com wrote:

> Dear Group,
>
> I was trying to convert the list to a set, with the following code:
>
> set1=set(list1)
>
> the code was running fine, but all on a sudden started to give the
> following error,
>
> set1=set(list1)
> TypeError: unhashable type: 'list'
>
> please let me know how may I resolve.
>
> And sometimes some good running program gives error all on a sudden with
> no parameter changed, how may I debug it?

Add a print statement before the offending line:

print list1
set1 = set(list1)

You will see that list1 contains another list, e. g. this works...

>>> list1 = ["alpha", "beta"]
>>> set(list1)
set(['alpha', 'beta'])

...while this doesn't:

>>> list1 = ["alpha", ["beta"]]
>>> set(list1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'

--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On Sunday, July 29, 2012 2:57:18 PM UTC+5:30, (unknown) wrote:
> Dear Group,
>
>
>
> I was trying to convert the list to a set, with the following code:
>
>
>
> set1=set(list1)
>
>
>
Dear Peter,
Thanks for the answer. But my list does not contain another list that is the issue. Intriguing. Thinking what to do.
Regards,
Subhabrata.
> the code was running fine, but all on a sudden started to give the following error,
>
>
>
> set1=set(list1)
>
> TypeError: unhashable type: 'list'
>
>
>
> please let me know how may I resolve.
>
>
>
> And sometimes some good running program gives error all on a sudden with no parameter changed, how may I debug it?
>
>
>
> Thanking You in Advance,
>
>
>
> Regards,
>
> Subhabrata Banerjee.

--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On 07/29/2012 02:30 PM, subhabangalore@gmail.com wrote:
> Thanks for the answer. But my list does not contain another list that is the issue. Intriguing. Thinking what to do.

What does your list contain? Can you reproduce the issue in a few
self-contained lines of code that you can show us, that we can test
ourselves?

--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
Hi,

Have you tried printing the list which is passed onto the set. The items in
the list passed should be hashable and possibly there are objects which are
not hashable.

On Sun, Jul 29, 2012 at 2:30 PM, <subhabangalore@gmail.com> wrote:

> On Sunday, July 29, 2012 2:57:18 PM UTC+5:30, (unknown) wrote:
> > Dear Group,
> >
> >
> >
> > I was trying to convert the list to a set, with the following code:
> >
> >
> >
> > set1=set(list1)
> >
> >
> >
> Dear Peter,
> Thanks for the answer. But my list does not contain another list that is
> the issue. Intriguing. Thinking what to do.
> Regards,
> Subhabrata.
> > the code was running fine, but all on a sudden started to give the
> following error,
> >
> >
> >
> > set1=set(list1)
> >
> > TypeError: unhashable type: 'list'
> >
> >
> >
> > please let me know how may I resolve.
> >
> >
> >
> > And sometimes some good running program gives error all on a sudden with
> no parameter changed, how may I debug it?
> >
> >
> >
> > Thanking You in Advance,
> >
> >
> >
> > Regards,
> >
> > Subhabrata Banerjee.
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Re: Python Error [ In reply to ]
On 29/07/2012 13:30, subhabangalore@gmail.com wrote:
> On Sunday, July 29, 2012 2:57:18 PM UTC+5:30, (unknown) wrote:
>> Dear Group,
>>
>> I was trying to convert the list to a set, with the following code:
>>
>> set1=set(list1)
>>
> Dear Peter,
> Thanks for the answer. But my list does not contain another list that is the issue. Intriguing. Thinking what to do.
> Regards,
> Subhabrata.

Can you loop round the list and print each entry and its type, that
should give you some clues?

>> the code was running fine, but all on a sudden started to give the following error,
>>
>> set1=set(list1)
>>
>> TypeError: unhashable type: 'list'
>>
>> please let me know how may I resolve.
>>
>> And sometimes some good running program gives error all on a sudden with no parameter changed, how may I debug it?
>>
>> Thanking You in Advance,
>>
>> Regards,
>>
>> Subhabrata Banerjee.
>


--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On Sun, Jul 29, 2012 at 01:08:57PM +0200, Peter Otten wrote:
> subhabangalore@gmail.com wrote:
>
> > Dear Group,
> >
> > I was trying to convert the list to a set, with the following code:
> >
> > set1=set(list1)
> >
> > the code was running fine, but all on a sudden started to give the
> > following error,
> >
> > set1=set(list1)
> > TypeError: unhashable type: 'list'
> >
>
> Add a print statement before the offending line:
>
> print list1
> set1 = set(list1)
>
> You will see that list1 contains another list, e. g. this works...
>

Peter's right, but instead of a print before the line, put a
try/except around it, like

try:
set1 = set(list1)
except TypeError:
print list1
raise

This way, only the *actual* error triggers any output. With a general
print before, you can get a lot of unnecessary output.

Grits, J
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On Sun, 29 Jul 2012 05:30:15 -0700, subhabangalore wrote:

> Dear Peter,
> Thanks for the answer. But my list does not contain another list that is
> the issue. Intriguing.

That is not what the error message says. You said that this line of code:

set1=set(list1)

gives this error:

TypeError: unhashable type: 'list'


Almost certainly, either you are mistaken about the line of code which
gives the error, or you are mistaken about the error, or you are mistaken
that your list does not contain any lists.


> Thinking what to do.

Exactly what Peter suggested: print the list before you try to convert it
to a set, and see what it actually contains.

It will also help you to read this page and try to follow its advice:

http://sscce.org/



--
Steven
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
In article <81818a9c-60d3-48da-9345-0c0dfd5b25e7@googlegroups.com>,
subhabangalore@gmail.com wrote:

> set1=set(list1)
>
> the code was running fine, but all on a sudden started to give the following
> error,
>
> set1=set(list1)
> TypeError: unhashable type: 'list'

First, make sure you understand what the error means. All the elements
of a set must be hashable. Lists are not hashable because they are
mutable. So, what the error is telling you is that some element of
list1 is itself a list, and therefore not hashable, and thus the set
can't be created.

I would start by printing list1. If the list is long (or contains
deeply nested structures), just doing "print list1" may result in
something that is difficult to read. In that case, try using pprint
(see the pprint module) to get a nicer display.

If it's still not obvious, pull out the bigger guns. Try something like:

for item in list1:
try:
hash(item)
except TypeError:
print "This one can't be hashed: %s" % item

> And sometimes some good running program gives error all on a sudden with no
> parameter changed

Well, *something* changed. Assuming nothing truly bizarre like a stray
Higgs Boson flipping a bit in your computer's memory, what you need to
do is figure out what that is. Did you change your code in any way
(having everything under version control helps here)? If not the code,
then what changed about the input?

If you're sure that both the code and the input are unchanged, that
leaves something in the environment. Did your python interpreter get
upgraded to a newer version? Or your operating system? PYTHONPATH?

Depending on what your program is doing, it could be something time
based. A different time zone, perhaps? Did daylight savings time just
go into or out of effect where you are? Does it only fail on Sunday?
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On Sunday, July 29, 2012 2:57:18 PM UTC+5:30, (unknown) wrote:
> Dear Group,
>
>
>
> I was trying to convert the list to a set, with the following code:
>
>
>
> set1=set(list1)
>
>
>
> the code was running fine, but all on a sudden started to give the following error,
>
>
>
> set1=set(list1)
>
> TypeError: unhashable type: 'list'
>
>
>
> please let me know how may I resolve.
>
>
>
> And sometimes some good running program gives error all on a sudden with no parameter changed, how may I debug it?
>
>
>
> Thanking You in Advance,
>
>
>
> Regards,
>
> Subhabrata Banerjee.

Dear Group,

Thank you for your kind time and reply. True as Steven pointed the error should be specific. I tested. Put comment mark before the set assignment, printed the list as Peter suggested, taken the print of the list, but no it is not my problem, as you suggested what is contained in the list, I am taking out the values and then assigning blank list and appending the processed values in the list.
If this kind of problems happen, --rare but in my 6 yrs Python experience happened sometimes--then I take a new window, rewrite or copy the earlier code module by module, give a new method name--believe it or not--- works.

Regards,
Subhabrata.
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On Sunday, July 29, 2012 7:53:59 PM UTC+5:30, Roy Smith wrote:
> In article <81818a9c-60d3-48da-9345-0c0dfd5b25e7@googlegroups.com>,
>
> subhabangalore@gmail.com wrote:
>
>
>
> > set1=set(list1)
>
> >
>
> > the code was running fine, but all on a sudden started to give the following
>
> > error,
>
> >
>
> > set1=set(list1)
>
> > TypeError: unhashable type: 'list'
>
>
>
> First, make sure you understand what the error means. All the elements
>
> of a set must be hashable. Lists are not hashable because they are
>
> mutable. So, what the error is telling you is that some element of
>
> list1 is itself a list, and therefore not hashable, and thus the set
>
> can't be created.
>
>
>
> I would start by printing list1. If the list is long (or contains
>
> deeply nested structures), just doing "print list1" may result in
>
> something that is difficult to read. In that case, try using pprint
>
> (see the pprint module) to get a nicer display.
>
>
>
> If it's still not obvious, pull out the bigger guns. Try something like:
>
>
>
> for item in list1:
>
> try:
>
> hash(item)
>
> except TypeError:
>
> print "This one can't be hashed: %s" % item
>
>
>
> > And sometimes some good running program gives error all on a sudden with no
>
> > parameter changed
>
>
>
> Well, *something* changed. Assuming nothing truly bizarre like a stray
>
> Higgs Boson flipping a bit in your computer's memory, what you need to
>
> do is figure out what that is. Did you change your code in any way
>
> (having everything under version control helps here)? If not the code,
>
> then what changed about the input?
>
>
>
> If you're sure that both the code and the input are unchanged, that
>
> leaves something in the environment. Did your python interpreter get
>
> upgraded to a newer version? Or your operating system? PYTHONPATH?
>
>
>
> Depending on what your program is doing, it could be something time
>
> based. A different time zone, perhaps? Did daylight savings time just
>
> go into or out of effect where you are? Does it only fail on Sunday?

Hi Roy,
Sorry I overlooked your answer. It fails generally on Sunday. True. How you got it? I recently downloaded Python2.7 64 bit -while I am working on Python3.2.1 64 bit Windows 7 SP1.
Regards,
Subhabrata Banerjee.
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On 7/29/2012 5:30 AM subhabangalore@gmail.com said...
> On Sunday, July 29, 2012 2:57:18 PM UTC+5:30, (unknown) wrote:
>> Dear Group,
>> I was trying to convert the list to a set, with the following code:
>> set1=set(list1)
> Thanks for the answer. But my list does not contain another list that is the issue. Intriguing. Thinking what to do.

Now you need to identify the type of the object that is causing python
to misreport the unhashable type causing the error as the error you're
getting says list and you say there isn't one. So, now we have a python
bug.

>>> set ([1,2,3])
set([1, 2, 3])
>>> set ([1,2,[]])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'list'
>>> set ([1,2,{}])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unhashable type: 'dict'



> the code was running fine, but all on a sudden started to give the
following error,
>
>
>
> set1=set(list1)
>
> TypeError: unhashable type: 'list'


Try adding the following:

for ii in list1:
try:
set([ii])
except:
print "this causes an error type (val): %s (%s)" (type(ii),ii)


Either it's a python bug or there really is a list in there.

Emile


--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On Mon, Jul 30, 2012 at 12:36 AM, <subhabangalore@gmail.com> wrote:
> If this kind of problems happen, --rare but in my 6 yrs Python experience happened sometimes--then I take a new window, rewrite or copy the earlier code module by module, give a new method name--believe it or not--- works.

If that solves your problem, it may be that you inadvertently shadowed
a built-in - maybe you assigned to "set" or "list" or something.

ChrisA
--
http://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
Jürgen A. Erhard <jae@jaerhard.com> wrote:

> Peter's right, but instead of a print before the line, put a
> try/except around it, like
>
> try:
> set1 = set(list1)
> except TypeError:
> print list1
> raise
>
> This way, only the *actual* error triggers any output. With a general
> print before, you can get a lot of unnecessary output.
>
> Grits, J
>

Or even better:

try:
set1 = set(list1)
except TypeError:
print list1
import pdb; pdb.set_trace()
raise

Then the error will print the value of list1 and drop you into the debugger
so you can examine what's going on in more detail.

--
Duncan Booth http://kupuguy.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Re: python error [ In reply to ]
On 11/3/2015 8:07 AM, Ruud van Rooijen wrote:
> my code:
>
> from tkinter import *
>
> window = Tk()
> label = Label(window, text="miniproject A1")
> label.pack()
> window.mainloop()
>
>
> given error:
>
> C:\Users\Ruud\Python35\Scripts\python.exe

Based on the below, python.exe should be in
C:\Users\Ruud\AppData\Local\Programs\Python\Python35-32
_tkinter should then be in
C:\Users\Ruud\AppData\Local\Programs\Python\Python35-32\DLLs

If you moved it, that is your problem.

If you have two python installations, with a second one in
C:\Users\Ruud\Python35, then python.exe should be in that directory, NOT
scripts.

> C:/Users/Ruud/PycharmProjects/School/project.py

I know essentially nothing about PyCharm, even if it is compatible with
tkinter.

> Traceback (most recent call last):
>
> File "C:/Users/Ruud/PycharmProjects/School/project.py", line 3, in <module>
>
> window = Tk()
>
> File "C:\Users\Ruud\AppData\Local\Programs\Python\Python35-32\Lib\tkinter\__init__.py",
> line 1867, in __init__
>
> self.tk = _tkinter.create(screenName, baseName, className,
> interactive, wantobjects, useTk, sync, use)
>
> _tkinter.TclError: Can't find a usable init.tcl in the following directories:
>
> C:/Users/Ruud/AppData/Local/Programs/Python/Python35-32/lib/tcl8.6
> C:/Users/Ruud/Python35/lib/tcl8.6 C:/Users/Ruud/lib/tcl8.6
> C:/Users/Ruud/Python35/library C:/Users/Ruud/library
> C:/Users/Ruud/tcl8.6.4/library C:/Users/tcl8.6.4/library

With a screwed up installation, or pair of installations, it looks
'everyplace' but the right place.

> This probably means that Tcl wasn't installed properly.

> i have repaired python several times and i can't find an answer online...
> please help

python.exe in scripts is not properly installed.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
On 1/16/2017 12:32 AM, Girish Khasnis wrote:
> Hi,
>
>
> I am unable to install Python on my system. After installing Python I get
> the below error when I try to open Python.
>
> [image: Inline image 1]

Copy and paste the error message. This is text only list.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
1. The command 'py' doesn't work. It gives me the error below :
C:\Users\mchak>pyFatal Python error: init_sys_streams: can't initialize sys standard streamsPython runtime state: core initializedAttributeError: module 'io' has no attribute 'open'
Current thread 0x00008290 (most recent call first):<no Python frame>

2. If I use py -0, I get two installed versions. However, if I try to uninstall from Control Panel, I see only 3.9 version
C:\Users\mchak>py -0Installed Pythons found by py Launcher for Windows -3.9-64 * -3.8-64
3. I tried to uninstall v3.9 and reinstall but it didn't solve the issue.
Regards,Mayukh
On Monday, November 23, 2020, 06:17:00 PM GMT, Barry Scott <barry@barrys-emacs.org> wrote:



> On 23 Nov 2020, at 14:10, Mayukh Chakraborty via Python-list <python-list@python.org> wrote:
>
> Hi,
> I had uninstalled and installed Python in Windows 10 but I am getting the error below. Can you please help ?
> C:\Users\mchak>pythonFatal Python error: init_sys_streams: can't initialize sys standard streamsPython runtime state: core initializedAttributeError: module 'io' has no attribute 'OpenWrapper'
> Current thread 0x00009d44 (most recent call first):<no Python frame>
> Regards,Mayukh

Which version of python are you installing and where did you download it from?
Do you have more than one version of python installed?


Does the command:

  py

work?

If you have python from python.org installed you should be able to list all the version you have installed
with the command:

  py -0

That is zero not oh.

Barry




> --
> https://mail.python.org/mailman/listinfo/python-list
>

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
Barry Scott wrote:

> If you have python from python.org installed you should be able to list all the version you have installed
> with the command:
>
> py -0
When was that '-0' feature added?
I have Python 3.6 from Python.org and here a
'py.exe -0' gives:
Requested Python version (0) not installed

But using 'py.exe -0' from Python 3.9 correctly
gives:
-3.6-32 *
-2.7-32

--
--gv
--
https://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
Thanks - I am able to launch 'py' from the command prompt and it gives me the python versions installed in my machine from python.org website.
However, when I am trying to execute a python program from command prompt, I am getting the error below. I had reinstalled python packages (numpy, pandas) but it didn't resolve the issue. Any help would be appreciated.
Original error was: No module named 'numpy.core._multiarray_umath'

---------------------------------------------------------------------------------------------------------------------------------------
C:\Users\mchak\Documents\Python>py ES.pyTraceback (most recent call last):  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py", line 22, in <module>    from . import multiarray  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\multiarray.py", line 12, in <module>    from . import overrides  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\overrides.py", line 7, in <module>    from numpy.core._multiarray_umath import (ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):  File "C:\Users\mchak\Documents\Python\ES.py", line 1, in <module>    import scipy as sp  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\scipy\__init__.py", line 61, in <module>    from numpy import show_config as show_numpy_config  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py", line 140, in <module>    from . import core  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py", line 48, in <module>    raise ImportError(msg)ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen formany reasons, often due to issues with your setup or how NumPy wasinstalled.
We have compiled some common reasons and troubleshooting tips at:
    https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
  * The Python version is: Python3.9 from "C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe"  * The NumPy version is: "1.19.4"
and make sure that they are the versions you expect.Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'

On Tuesday, November 24, 2020, 07:13:04 AM GMT, Gisle Vanem <gisle.vanem@gmail.com> wrote:

Barry Scott wrote:

> If you have python from python.org installed you should be able to list all the version you have installed
> with the command:
>
>    py -0
When was that '-0' feature added?
I have Python 3.6 from Python.org and here a
'py.exe -0' gives:
  Requested Python version (0) not installed

But using 'py.exe -0' from Python 3.9 correctly
gives:
  -3.6-32 *
  -2.7-32

--
--gv
--
https://mail.python.org/mailman/listinfo/python-list

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
Two observations.

Python.exe is not on your PATH. But that does not matter as you can use the py command instead

And nymph may not be available for python 3.9 yet. Check on pypi to see if there is a build for 3.9.

Maybe use 3.8 for the time being.
Barry

> On 24 Nov 2020, at 11:18, Mayukh Chakraborty via Python-list <python-list@python.org> wrote:
>
> ? Thanks - I am able to launch 'py' from the command prompt and it gives me the python versions installed in my machine from python.org website.
> However, when I am trying to execute a python program from command prompt, I am getting the error below. I had reinstalled python packages (numpy, pandas) but it didn't resolve the issue. Any help would be appreciated.
> Original error was: No module named 'numpy.core._multiarray_umath'
>
> ---------------------------------------------------------------------------------------------------------------------------------------
> C:\Users\mchak\Documents\Python>py ES.pyTraceback (most recent call last): File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py", line 22, in <module> from . import multiarray File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\multiarray.py", line 12, in <module> from . import overrides File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\overrides.py", line 7, in <module> from numpy.core._multiarray_umath import (ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last): File "C:\Users\mchak\Documents\Python\ES.py", line 1, in <module> import scipy as sp File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\scipy\__init__.py", line 61, in <module> from numpy import show_config as show_numpy_config File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py", line 140, in <module> from . import core File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py", line 48, in <module> raise ImportError(msg)ImportError:
> IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
> Importing the numpy C-extensions failed. This error can happen formany reasons, often due to issues with your setup or how NumPy wasinstalled.
> We have compiled some common reasons and troubleshooting tips at:
> https://numpy.org/devdocs/user/troubleshooting-importerror.html
> Please note and check the following:
> * The Python version is: Python3.9 from "C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe" * The NumPy version is: "1.19.4"
> and make sure that they are the versions you expect.Please carefully study the documentation linked above for further help.
> Original error was: No module named 'numpy.core._multiarray_umath'
>
>> On Tuesday, November 24, 2020, 07:13:04 AM GMT, Gisle Vanem <gisle.vanem@gmail.com> wrote:
>>
>> Barry Scott wrote:
>>
>> If you have python from python.org installed you should be able to list all the version you have installed
>> with the command:
>>
>> py -0
> When was that '-0' feature added?
> I have Python 3.6 from Python.org and here a
> 'py.exe -0' gives:
> Requested Python version (0) not installed
>
> But using 'py.exe -0' from Python 3.9 correctly
> gives:
> -3.6-32 *
> -2.7-32
>
> --
> --gv
> --
> https://mail.python.org/mailman/listinfo/python-list
>
> --
> https://mail.python.org/mailman/listinfo/python-list

--
https://mail.python.org/mailman/listinfo/python-list
Re: Python Error [ In reply to ]
Thanks.
I updated the path and was able to launch python.exe for v3.8. I got rid of the other errors but now facing an error with 'pandas' although  it is installed ok and the path correctly updated.
C:\Users\mchak>pythonPython 3.8.6 (tags/v3.8.6:db45529, Sep 23 2020, 15:52:53) [MSC v.1927 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>> import pandas as pdTraceback (most recent call last):  File "<stdin>", line 1, in <module>  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\pandas\__init__.py", line 22, in <module>    from pandas.compat.numpy import (ModuleNotFoundError: No module named 'pandas.compat.numpy'>>>
- Mayukh


On Tuesday, November 24, 2020, 09:27:00 PM GMT, Barry <barry@barrys-emacs.org> wrote:

Two observations.

Python.exe is not on your PATH. But that does not matter as you can use the py command instead

And nymph may not be available for python 3.9 yet. Check on pypi to see if there is a build for 3.9.

Maybe use 3.8 for the time being.
Barry

> On 24 Nov 2020, at 11:18, Mayukh Chakraborty via Python-list <python-list@python.org> wrote:
>
> ? Thanks - I am able to launch 'py' from the command prompt and it gives me the python versions installed in my machine from python.org website.
> However, when I am trying to execute a python program from command prompt, I am getting the error below. I had reinstalled python packages (numpy, pandas) but it didn't resolve the issue. Any help would be appreciated.
> Original error was: No module named 'numpy.core._multiarray_umath'
>
> ---------------------------------------------------------------------------------------------------------------------------------------
> C:\Users\mchak\Documents\Python>py ES.pyTraceback (most recent call last):  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py", line 22, in <module>    from . import multiarray  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\multiarray.py", line 12, in <module>    from . import overrides  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\overrides.py", line 7, in <module>    from numpy.core._multiarray_umath import (ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
> During handling of the above exception, another exception occurred:
> Traceback (most recent call last):  File "C:\Users\mchak\Documents\Python\ES.py", line 1, in <module>    import scipy as sp  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\scipy\__init__.py", line 61, in <module>    from numpy import show_config as show_numpy_config  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\__init__.py", line 140, in <module>    from . import core  File "C:\Users\mchak\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\numpy\core\__init__.py", line 48, in <module>    raise ImportError(msg)ImportError:
> IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
> Importing the numpy C-extensions failed. This error can happen formany reasons, often due to issues with your setup or how NumPy wasinstalled.
> We have compiled some common reasons and troubleshooting tips at:
>    https://numpy.org/devdocs/user/troubleshooting-importerror.html
> Please note and check the following:
>  * The Python version is: Python3.9 from "C:\Users\mchak\AppData\Local\Programs\Python\Python39\python.exe"  * The NumPy version is: "1.19.4"
> and make sure that they are the versions you expect.Please carefully study the documentation linked above for further help.
> Original error was: No module named 'numpy.core._multiarray_umath'
>
>>    On Tuesday, November 24, 2020, 07:13:04 AM GMT, Gisle Vanem <gisle.vanem@gmail.com> wrote: 
>>
>> Barry Scott wrote:
>>
>> If you have python from python.org installed you should be able to list all the version you have installed
>> with the command:
>>
>>    py -0
> When was that '-0' feature added?
> I have Python 3.6 from Python.org and here a
> 'py.exe -0' gives:
>  Requested Python version (0) not installed
>
> But using 'py.exe -0' from Python 3.9 correctly
> gives:
>  -3.6-32 *
>  -2.7-32
>
> --
> --gv
> --
> https://mail.python.org/mailman/listinfo/python-list
>
> --
> https://mail.python.org/mailman/listinfo/python-list

--
https://mail.python.org/mailman/listinfo/python-list