Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError when importing Numpy in Object Explorer #11988

Closed
6 of 10 tasks
pranjal5399 opened this issue Mar 26, 2020 · 2 comments
Closed
6 of 10 tasks

OSError when importing Numpy in Object Explorer #11988

pranjal5399 opened this issue Mar 26, 2020 · 2 comments

Comments

@pranjal5399
Copy link

pranjal5399 commented Mar 26, 2020

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Spyder is not launching in my laptop. Its giving traceback call. I have tried to update conda from anaconda prompt shell but its still not working.

What steps reproduce the problem?

  1. I launch Anaconda navigator.
  2. From there I launched spyder.
  3. Thats where it caused problem.

What is the expected output? What do you see instead?

I see a traceback call

Paste Traceback/Error Below (if applicable)

Traceback (most recent call last):
File "C:\Users\Pranjal\anaconda3\Scripts\spyder-script.py", line 10, in 
sys.exit(main())
File "C:\Users\Pranjal\anaconda3\lib\site-packages\spyder\app\start.py", line 201, in main
from spyder.app import mainwindow
File "C:\Users\Pranjal\anaconda3\lib\site-packages\spyder\app\mainwindow.py", line 167, in 
from spyder.utils.environ import WinUserEnvDialog
File "C:\Users\Pranjal\anaconda3\lib\site-packages\spyder\utils\environ.py", line 19, in 
from spyder.plugins.variableexplorer.widgets.collectionseditor import (
File "C:\Users\Pranjal\anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\collectionseditor.py", line 57, in 
from spyder.plugins.variableexplorer.widgets.collectionsdelegate import (
File "C:\Users\Pranjal\anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\collectionsdelegate.py", line 31, in 
from spyder.plugins.variableexplorer.widgets.objectexplorer.attribute_model \
File "C:\Users\Pranjal\anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\objectexplorer\__init__.py", line 19, in 
from .attribute_model import DEFAULT_ATTR_COLS, DEFAULT_ATTR_DETAILS
File "C:\Users\Pranjal\anaconda3\lib\site-packages\spyder\plugins\variableexplorer\widgets\objectexplorer\attribute_model.py", line 29, in 
import numpy as np
File "C:\Users\Pranjal\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 142, in 
from . import core
File "C:\Users\Pranjal\AppData\Roaming\Python\Python37\site-packages\numpy\core\__init__.py", line 23, in 
WinDLL(os.path.abspath(filename))
File "C:\Users\Pranjal\anaconda3\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application

Versions

  • Spyder version: 4.0.1
  • Python version: 3.7.6
  • Qt version: 5.9.7
  • PyQt version: 5.9.2
  • Operating System name/version: Windows 10 Home

Dependencies

PASTE DEPENDENCIES HERE
@ccordoba12 ccordoba12 changed the title Spyder is not launching in my laptop. OSError when importing Numpy in Object Explorer Mar 26, 2020
@ccordoba12
Copy link
Member

Please remove this directory

C:\Users\Pranjal\AppData\Roaming\Python

Also, please do not use pip to install packages that can be installed by conda in the future. This error was caused because you installed Numpy with pip.

@ccordoba12
Copy link
Member

@steff456, please take a look at this one. The idea is very simple: please change the ImportError below by an Exception to catch any kind of error when importing Numpy at that point:

try:
import numpy as np
except ImportError:
_NUMPY_INSTALLED = False
else:
_NUMPY_INSTALLED = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v4.1.2
Release
Development

No branches or pull requests

3 participants