According to the FiPy website, you need "at least one of the solvers", and they list SciPy as one possible "solver". I definitely have SciPy installed - I can import it with import scipy. I haven't formally installed FiPy with setup.py or anything like that, I just have the code in a folder called fipy. When I then go into the Python shell and type import fipy, I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "fipy/__init__.py", line 44, in <module>
from solvers import *
File "fipy/solvers/__init__.py", line 68, in <module>
raise ImportError, "Could not import any solver package. If you are using Trilinos, make sure you have all of the necessary Trilinos packages installed - Epetra, EpetraExt, AztecOO, Amesos, ML, and IFPACK."
ImportError: Could not import any solver package. If you are using Trilinos, make sure you have all of the necessary Trilinos packages installed - Epetra, EpetraExt, AztecOO, Amesos, ML, and IFPACK.
I've already tried doing this after formally installing FiPy via setup.py (using pip didn't work, I got some strange error relating to tensorflow). Setting the FIPY_SOLVERS environment variable didn't work either (same error).
I'm on Ubuntu with Python 2.7.
Based on File "fipy/__init__.py", line 44, in <module> and File "fipy/solvers/__init__.py", line 68, in <module>, you appear to be running FiPy 2.1.x, which is quite old.
Please upgrade.
Related
I have a question about using numpy library.
A couple of months ago, I downloaded Anaconda, which gives numpy automatically.
I am trying to use numpy by importing from ANaconda to Python.
WHat I have done is:
I added the package of numpy from Anaconda folder to Python folder.
However, the python shell says that
File "C:\Users\Alice Jun\Desktop\Python 3.9\numpy\core\__init__.py", line 22, in <module>
from . import multiarray
File "C:\Users\Alice Jun\Desktop\Python 3.9\numpy\core\multiarray.py", line 12, in <module>
from . import overrides
File "C:\Users\Alice Jun\Desktop\Python 3.9\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\Alice Jun\Desktop\Python 3.9\gui.py", line 2, in <module>
import numpy as np
File "C:\Users\Alice Jun\Desktop\Python 3.9\numpy\__init__.py", line 140, in <module>
from . import core
File "C:\Users\Alice Jun\Desktop\Python 3.9\numpy\core\__init__.py", line 48, in <module>
raise ImportError(msg)
What should I do to import numpy?
Thank you and stay safe!
As others mentioned, that is not a proper way of installing a package. You are making a copy anyway, so install it through proper routes, e.g.,
# where `python` is the one you wish to use
python -m pip install numpy
Otherwise, the reason why what OP shows did not work is because packages are located under a site-packages directory (search under your Python 3.9/ directory. If one really wants to manually install a package, that's where it goes.
However, be aware that Conda packages make heavy use of dynamic linking in order to minimize redundancy of common dependencies. This is often done through #rpath specifications, which means moving packages out of their Conda environment path will frequently result in non-functionality.
When I try to import numpy I get some long error which gives me instructions to try and fix the problem.
I read it through and tried the solutions but none worked. I just want to import numpy.
import numpy
The error:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/numpy/core/__init__.py", line 40, in <module>
File "/usr/local/lib/python3.7/site-packages/numpy/core/multiarray.py", line 12, in <module>
File "/usr/local/lib/python3.7/site-packages/numpy/core/overrides.py", line , in <module>
ImportError: PyCapsule_Import could not import module "datetime"
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "Solution.py", line 1, in <module>
import numpy
File "/usr/local/lib/python3.7/site-packages/numpy/__init__.py", line 142, in <module>
File "/usr/local/lib/python3.7/site-packages/numpy/core/__init__.py", line 71, in <module>
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
Here is how to proceed:
- If you're working with a numpy git repository, try `git clean -xdf`
22(removes all files not under version control) and rebuild numpy.
- If you are simply trying to use the numpy version that you have installed:
your installation is broken - please reinstall numpy.
- If you have already reinstalled and that did not fix the problem, then:
1. Check that you are using the Python you expect (you're using /usr/local/bin/python3),
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy versions you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
how you installed Python
how you installed numpy
your operating system
whether or not you have multiple versions of Python installed
if you built from source, your compiler versions and ideally a build log
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: PyCapsule_Import could not import module "datetime"
Also when I run any numpy function I get a segmentation error what does that mean and are there any fixes?
This happens when I try to do:
import scipy.io
Another scipy module, such as scipy.sparse, seems to be OK.
The root error is:
packages/scipy/special/__init__.py", line 636, in <module>
from ._ufuncs import *
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): Symbol not found: ___addtf3
The full stack trace:
Traceback (most recent call last):
File "HistogramClassifier.py", line 3, in <module>
import scipy.io
File "/usr/local/lib/python2.7/site-packages/scipy/io/__init__.py", line 97, in <module>
from .matlab import loadmat, savemat, whosmat, byteordercodes
File "/usr/local/lib/python2.7/site-packages/scipy/io/matlab/__init__.py", line 13, in <module>
from .mio import loadmat, savemat, whosmat
File "/usr/local/lib/python2.7/site-packages/scipy/io/matlab/mio.py", line 12, in <module>
from .miobase import get_matfile_version, docfiller
File "/usr/local/lib/python2.7/site-packages/scipy/io/matlab/miobase.py", line 22, in <module>
from scipy.misc import doccer
File "/usr/local/lib/python2.7/site-packages/scipy/misc/__init__.py", line 51, in <module>
from scipy.special import comb, factorial, factorial2, factorialk
File "/usr/local/lib/python2.7/site-packages/scipy/special/__init__.py", line 636, in <module>
from ._ufuncs import *
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/scipy/special/_ufuncs.so, 2): Symbol not found: ___addtf3
Referenced from: /usr/local/lib/python2.7/site-packages/scipy/special/../.dylibs/libquadmath.0.dylib
Expected in: /usr/lib/libSystem.B.dylib
in /usr/local/lib/python2.7/site-packages/scipy/special/../.dylibs/libquadmath.0.dylib
That's pretty much it. Google returns quite a few hits, but they're either very old, or not the same lib, or things that I've tried. The rest of this post is all the stuff I found/tried so far that didn't work.
Double checking python:
which python
/usr/local/bin/python
ls -l /usr/local/bin/python
lrwxr-xr-x ... /usr/local/bin/python -> ../Cellar/python/2.7.13/bin/python
I'm not currently using virtual env.
I think Homebrew is OK:
brew doctor
Your system is ready to brew.
This is after trying this:
brew update
brew upgrade
I've also tried uninstalling and reinstalling the scipy package, both with brew and with pip.
I've tried various other things, but don't want to mess up a working Homebrew setup.
Older posts that Google brought back talk about "cobra", as far as I know I'm not using that. "which cobra" doesn't return anything.
Other things from Google talk about the order of the library path, but that seemed to be if you were using the built-in python, which I don't don't think is applicable since I believe I'm using Homebrew's version.
Clearly it has something to do with a library, maybe fortran related, but what to type in to fix it... don't know where to start.
Try this: remove /usr/lib/libSystem.B.dylib temporarily and then reinstall scipy.
I've read all of the same error post on google, checked my python and opengl files then installed more python stuff (showing pertinent to this problem)
python-2.7.12_1
python3.4-3.4.5_1
python3.5-3.5.2_1
python-enum34-1.1.6_1
python3.4-PyQt5-5.6_1
python3.4-PyQt5-opengl-5.6_1
python-PyQt5-opengl-5.6_1
python-numpy-1.11.1_1
and from source
PyOpenGL-3.1.1a1
and I am still getting this error when trying to start mankhuman.py
NUMPY.VERSION: 1.11.1
Traceback (most recent call last):
File "./makehuman.py", line 827, in <module>
main()
File "./makehuman.py", line 817, in main
from mhmain import MHApplication
File "./core/mhmain.py", line 45, in <module>
import mh
File "./lib/mh.py", line 43, in <module>
from glmodule import grabScreen, hasRenderSkin, renderSkin, getPickedColor, hasRenderToRenderbuffer, renderToBuffer, renderAlphaMask
File "./lib/glmodule.py", line 42, in <module>
import OpenGL
ImportError: No module named OpenGL
I am now at a loss as I cannot figure it out.. anyone got an idea that may (will) work?
You need to install the packages that provide the OpenGL libraries. Usually these are included in the development or library packages for your graphics card. It doesn't seem like Void Linux installs dependencies for you, so you'll need to install them yourself, and this will depend on the graphics driver you're using. If you use mesa, install MesaLib-devel. If you use Nvidia, install nvidia-libs. If you use AMD, I don't know what you should install. I'm not familiar with Void Linux so you might need to experiment with variations of the above. Good luck!
I usually code in Matlab but I found a nice piece of PYTHON code that I would like to use. However having downloaded the package it is proving difficult to run. I'm getting the following error:
Traceback (most recent call last):
File "C:\launch.py", line 29, in <module>
from src.smcsquare import SMCsquare
File "C:\src\smcsquare.py", line 32, in <module>
from scipy.stats import norm
File "C:\Python34\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
from .stats import *
File "C:\Python34\lib\site-packages\scipy\stats\stats.py", line 184, in <module>
import scipy.special as special
File "C:\Python34\lib\site-packages\scipy\special\__init__.py", line 586, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
The _ufuncs.pyd is there in the C:\Python34\lib\site-packages\scipy\special\ directory. I tried adding this to my PYTHONPATH but it made no difference. I have also tried so dll fixers but these have not helped.
Has anyone encountered this and did you find a solution?
As other have said, make sure your .whl file matches the version and 32/64bit of the python distribution you're using.
Next, the problem I was having was I forgot to download and install the extra "numpy+mkl" package per the instruction: http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy
So for me it was numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl, which I downloaded and then:
python -m pip install numpy-1.11.0+mkl-cp35-cp35m-win_amd64.whl
I had already installed the regular numpy package via pip, but I just installed this one over it and everything started working and has been fine so far.