Comments (3)
What's happening is that Python prefers to look for modules in relative paths before absolute paths. Since you can import noise from the repo directory, that means it's probably already in your python path(an absolute path).
Say this repository lives in foo/noise/
and now you are in foo/
if you go up a directory and try to run import noise
. Python will see that the local directory noise/
as a module because it has an __init__.py
file and try to import the directory instead of the module installed in your python path. Since this module requires the _noise
and _simplex
C extensions to be compiled, this wont work.
I'd recommend removing or renaming this repo directory from your project and use pip to install noise if you haven't already. (pip install noise
)
If you really want to install from source and not install into your system, then, in the noise/
repository, run python setup.py build
to build locally and grab dist/lib*/noise/
and put that directory into your project directory.
Alternatively use python setup.py install
in the noise/
repository to install from source into your Python path.
from noise.
Hey thanks for the detailed response. I originally installed it using python setup.py install
as you say. Moving it out of the working directory did in fact resolve the issue. Thanks! Quick follow up question though: I also have other modules like caffe, and protobuf in that directory. Why can I import those with no issue?
Edit: For some reason this seems to have broken caffe now... When running my original script (even without importing noise) it gives me this:
Traceback
(most recent call last):
File "live.py", line 13, in
import caffe
File "/home/chris/code/deepDream/caffe/python/caffe/init.py", line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
File "/home/chris/code/deepDream/caffe/python/caffe/pycaffe.py", line 13, in
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ImportError: libcudart.so.7.5: cannot open shared object file: No such file or directory
Why would just moving the noise directory fuck with caffe?
Edit Edit: Ugh, nevermind. Several different, independent things are throwing the same error about missing .so files... It looks like this issue is distinct from anything happening with the noise lib.
from noise.
You're welcome.
__init__.py
depends on _perlin
and _simplex
which are shared object files compiled from Python C extensions. If you did python setup.py build
and then copied dist/lib*/*.so
(assuming you're on linux) into the main noise repo directory, then what you are doing would work.
from noise.
Related Issues (20)
- Error during the installation HOT 6
- noise fails to install with pip HOT 4
- noisemachine.com is offline ? HOT 1
- Where should the grad2 symbol in _perlin.so come from? HOT 13
- How to randomize the noise?
- cannot import name _perlin after running install.py successfully from master HOT 2
- README link to information on simplex noise is broken HOT 2
- [Discussion] Adding type hints?
- Segfault on snoise4 with lacunarity argument
- ImportError: Error relocating .../_perlin.cpython-37m-x86_64-linux-gnu.so: grad2: symbol not found HOT 1
- Add inverse function
- Can't import noise
- Could you update the latest version to pypi?
- Cant install noise via pip HOT 5
- IndexError
- Hot to credit noise
- Base in py_noise2 doesn't do *anything*
- ModuleNotFoundError: No module named 'noise.connection' HOT 2
- SegFault in pnoise2 when providing large seeds
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from noise.