Problem with install seaborn module in Pycharm Application - python

I am trying the import the seaborn module (using Python 3.7) into my project (I'm using the Pycharm application). Here's my code:
import os
import google_auth_oauthlib.flow
import googleapiclient.discovery
import pandas as pd
import seaborn as sns
Here's the error message that I got executing the above code:
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/test/main.py", line 6, in <module>
import seaborn
File "C:\Users\user\PycharmProjects\test\venv\lib\site-packages\seaborn\__init__.py", line 6, in <module>
from .rcmod import *
File "C:\Users\user\PycharmProjects\test\venv\lib\site-packages\seaborn\rcmod.py", line 7, in <module>
from . import palettes, _orig_rc_params
File "C:\Users\user\PycharmProjects\test\venv\lib\site-packages\seaborn\palettes.py", line 9, in <module>
from .utils import desaturate, set_hls_values, get_color_cycle
File "C:\Users\user\PycharmProjects\test\venv\lib\site-packages\seaborn\utils.py", line 6, in <module>
from scipy import stats
File "C:\Users\user\PycharmProjects\test\venv\lib\site-packages\scipy\__init__.py", line 136, in <module>
from . import _distributor_init
File "C:\Users\user\PycharmProjects\test\venv\lib\site-packages\scipy\_distributor_init.py", line 61, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2288.0_x64__qbz5n2kfra8p0\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
Does anyone know why the seaborn module could not be found? I added the seaborn package already using the python interpreter.

Related

dll error when trying to import a package, but running that same env in the terminal allows to import the package

As the title states PyCharm is giving me a weird error. I have the Conda env activated in my terminal, and I have the interpreter set for PyCharm, but when I try to
import seaborn
I get a
File "C:/name/projects/dir/project.py", line 4, in <module>
import seaborn as sns
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\seaborn\__init__.py", line 2, in <module>
from .rcmod import * # noqa: F401,F403
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\seaborn\rcmod.py", line 7, in <module>
from . import palettes
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\seaborn\palettes.py", line 9, in <module>
from .utils import desaturate, get_color_cycle
File "C:\Users\user\AppData\Roaming\Python\Python37\site-packages\seaborn\utils.py", line 10, in <module>
from scipy import stats
File "C:\venvs\virtual_env\lib\site-packages\scipy\stats\__init__.py", line 345, in <module>
from .stats import *
File "C:\venvs\virtual_env\lib\site-packages\scipy\stats\stats.py", line 169, in <module>
import scipy.special as special
File "C:\venvs\virtual_env\lib\site-packages\scipy\special\__init__.py", line 640, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1
But when I run
import seaborn
in my terminal I don't get this error. Any ideas/explanations?

importing matplotlib.pyplot as plt in pycharm fails due to Numpy

I am having a problem with importing matplotlib,
seems like I messed up something in the configurations
(it was working perfectly for two weeks of daily programming)
Trying to import matplotlib
import matplotlib.pyplot as plt
now I am getting:
C:\Users\Rami\Anaconda3\python.exe "C:/Users/Rami/PycharmProjects/project new/ml1.py"
Traceback (most recent call last):
File "C:/Users/Rami/PycharmProjects/project new/ml1.py", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Users\Rami\CONDA3\lib\site-packages\matplotlib\__init__.py", line 138, in <module>
from . import cbook, rcsetup
File "C:\Users\Rami\CONDA3\lib\site-packages\matplotlib\cbook\__init__.py", line 31, in <module>
import numpy as np
File "C:\Users\Rami\AppData\Roaming\Python\Python37\site-packages\numpy\__init__.py", line 140, in <module>
from . import _distributor_init
File "C:\Users\Rami\AppData\Roaming\Python\Python37\site-packages\numpy\_distributor_init.py", line 26, in <module>
WinDLL(os.path.abspath(filename))
File "C:\Users\Rami\CONDA3\Lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 193] %1 is not a valid Win32 application
Process finished with exit code 1
From the error trace, it seems that it is caused by a failure to import Numpy.
Yes I have changes some stuff in the settings but have no idea what led to this
I am working with Python 3.5

import error but in the program init, can someone help me? (Python 2.7.14)

I have those errors when i'm trying to import the matplotlib.
How can i fix this?
I have install matplotlib with the pip install matplotlib and this was a succes.
But when i import the package i have this kind of error.
i see it is in the init block but how can i fix this?
i have already tried the pip matplotlib upgrade but this keeps the same problem.
i just have matplotlib uninstalled and back installed and it is the same problem.
My code:
import matplotlib.pyplot as plt
Error:
Traceback (most recent call last):
File "C:\Python27\TEST.py", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 26, in <module>
from matplotlib.figure import Figure, figaspect
File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 24, in <module>
import matplotlib.artist as martist
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 7, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, \
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 35, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: DLL load failed: %1 is geen geldige Win32-toepassing
I have tried another code, that I found in the comments. But this generate my another error code.
Code :
import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt
Error:
Traceback (most recent call last):
File "C:\Python27\TEST.py", line 1, in <module>
import matplotlib as mpl
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 1097, in <module>
rcParams = rc_params()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 933, in rc_params
fname = matplotlib_fname()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 781, in matplotlib_fname
for fname in gen_candidates():
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 770, in gen_candidates
yield os.path.join(six.moves.getcwd(), 'matplotlibrc')
AttributeError: '_MovedItems' object has no attribute 'getcwd'
Error
Little test program
A "p" seems to be missing from "pyplot". You have pylot instead of pyplot in the import statement.

Py2exe + nibabel

When I try to launch the application (.exe) file created by p2toexe, I receive the following error message:
Traceback (most recent call last):
File "main_GUI.py", line 12, in <module>
File "nibabel\__init__.pyc", line 38, in <module>
File "nibabel\analyze.pyc", line 87, in <module>
File "nibabel\volumeutils.pyc", line 22, in <module>
File "nibabel\casting.pyc", line 11, in <module>
File "nibabel\testing\__init__.pyc", line 35, in <module>
File "nibabel\testing\np_features.pyc", line 19, in <module>
File "nibabel\testing\np_features.pyc", line 12, in _memmap_after_ufunc
IOError: [Errno 2] No such file or directory: 'C:\\Work\\PyToExe\\GUI\\v4\\dist\\lib2\\library.lib\\nibabel\\testing\\np_features.pyc'
When I ran the original Python script, no errors were raised with regard to importing nibabel.
In response to #Sagar's comment:
The import in the file Main_GUI.m:
from __future__ import print_function
import matplotlib.pyplot as plt
from matplotlib import widgets
import numpy as np
import nibabel as nib
import matplotlib as mpl
import time
import os
there was a problem of compatibility between the modules versions (py2exe==0.6.9 and nibabel==2.2.0).
It works with py2exe 0.6.9 and nibabel 2.1.0.

Import error when using skvideo.io

I am trying to import skvideo.io in python 3.6.3 but getting an import error. I installed skvideo through pip and it was installed successfully.
The is the error I am getting
Traceback (most recent call last): File "", line 1, in
import skvideo.io File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\skvideo__init__.py",
line 3, in
from .utils import check_output, where File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\skvideo\utils__init__.py",
line 10, in
from .edge import canny File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\skvideo\utils\edge.py",
line 8, in
import scipy.ndimage File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\ndimage__init__.py",
line 161, in
from .filters import * File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\ndimage\filters.py",
line 37, in
from scipy.misc import doccer File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\misc__init__.py",
line 67, in
from scipy.interpolate._pade import pade as _pade File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\interpolate__init__.py",
line 175, in
from .interpolate import * File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\interpolate\interpolate.py",
line 20, in
import scipy.linalg File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\linalg__init__.py",
line 186, in
from .misc import * File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\linalg\misc.py",
line 5, in
from .blas import get_blas_funcs File "C:\Users\Hasan\AppData\Local\Programs\Python\Python36\lib\site-packages\scipy\linalg\blas.py",
line 196, in
from scipy.linalg import _fblas ImportError: DLL load failed: The specified module could not be found.
Can someone help me out

Categories