Comments (9)
I think nimpy is using python3 on your system. It tries to find the most recent python version. To verify that:
import nimpy
echo pyImport("sys").path
and compare it to
python -c "import sys; print(sys.path)"
from nimpy.
doesn't look like it:
nim c -r main.nim
import nimpy
echo pyImport("sys").path
['/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/timothee/Library/Python/2.7/lib/python/site-packages', '/Users/timothee/homebrew/lib/python2.7/site-packages', '/Users/timothee/homebrew/Cellar/numpy/1.15.4_2/libexec/nose/lib/python2.7/site-packages', '/Users/timothee/homebrew/Cellar/protobuf/3.6.1.3/libexec/lib/python2.7/site-packages', '/Users/timothee/homebrew/opt/llvm_tim/lib/python2.7/site-packages', '/Users/timothee/homebrew/lib/python2.7/site-packages', '/Users/timothee/homebrew/Cellar/numpy/1.15.4_2/libexec/nose/lib/python2.7/site-packages', '/Users/timothee/homebrew/opt/llvm_tim/lib/python2.7/site-packages']
python -c "import sys; print(sys.path)"
['', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Users/timothee/homebrew/Cellar/python@2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Users/timothee/Library/Python/2.7/lib/python/site-packages', '/Users/timothee/homebrew/lib/python2.7/site-packages', '/Users/timothee/homebrew/Cellar/numpy/1.15.4_2/libexec/nose/lib/python2.7/site-packages', '/Users/timothee/homebrew/Cellar/protobuf/3.6.1.3/libexec/lib/python2.7/site-packages', '/Users/timothee/homebrew/opt/llvm_tim/lib/python2.7/site-packages', '/Users/timothee/homebrew/lib/python2.7/site-packages', '/Users/timothee/homebrew/Cellar/numpy/1.15.4_2/libexec/nose/lib/python2.7/site-packages', '/Users/timothee/homebrew/opt/llvm_tim/lib/python2.7/site-packages']
from nimpy.
Ok. And python -c 'import numpy'
doesn't raise any errors?
from nimpy.
it doesn't
from nimpy.
Googling around this problem is vaguely described as a conflict between the system python and brew python. Could it so happen that python
binary comes from the system python, and the dylib loaded by nimpy comes from brew, or the other way around?
from nimpy.
Could it so happen that python binary comes from the system python, and the dylib loaded by nimpy comes from brew, or the other way around?
If so, it might be connected to #46
from nimpy.
If so, it might be connected to #46
Yeah, but not really, because any installed python dll should work. And this is just a system (brew?) bug.
from nimpy.
update: this is related to https://stackoverflow.com/questions/47658596/strange-mixing-of-system-homebrew-python-with-lldb
this works:
PATH=/usr/bin:$PATH nimble test
but not ideal obviously as it has other side effects
from nimpy.
Well I don't see a way to fix this properly. Even with python selection functionality in place, there still remains the possibility to hit this. Because, let me repeat it, I treat this as an os/environment issue. But feel free to prove me wrong.
from nimpy.
Related Issues (20)
- Support for more than one argument type
- be safe HOT 1
- calling variable binded functions
- No callable attribute: exec [ValueError] HOT 6
- `SIGSEGV: Illegal storage access` error when trying to `echo py.exec("invalid python")` HOT 1
- How to use it with multithreading? HOT 2
- Iterators not exported when using PyNimObjectExperimental
- Custom setting the path to python.exe (Windows) HOT 1
- nim is slower than python HOT 3
- Exported type does not have attributes and python default functions. HOT 1
- Hello world Segmentation fault HOT 2
- Is it possible to export async proc? HOT 1
- error: cannot bind packed field HOT 1
- Memory management issues. (workaround exists) HOT 1
- There are some exceptions when trying to use in a generic type proc, it doesn't seem to work properly in a generic type proc HOT 1
- Using nimpy in a multithreaded application? HOT 1
- Could not find platform dependent libraries <exec_prefix> HOT 3
- Codon
- have some trouble printing a module's version HOT 1
- keeping long lived objects alive from python HOT 2
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 nimpy.