Comments (3)
I too am having this problem. (Python 3.9.13 Anaconda install on Windows).
from nimpy.
It seems it has more to do with anaconda/venv rather than with nimpy: https://stackoverflow.com/questions/19292957/how-can-i-troubleshoot-python-could-not-find-platform-independent-libraries-pr
I've never used venv so can't tell for sure. I'm open to suggestions if there's anything we can do.
from nimpy.
I was struggling for a while trying to call a python func FROM nim, but the func depends on a library installed in a virtual env
from pyfiglet import Figlet
def test():
f = Figlet(font='slant')
print(f.renderText('text to render'))
here is my nim code and here is the compile script
nim c -r main.nim
import strutils
import nimpy
let py = pyImport("main")
discard py.test()
when compiling I would get an error saying the module was not found
Error: unhandled exception: <class 'ModuleNotFoundError'>: No module named 'pyfiglet' [Exception]
I solved this by modifying the sys path IN my python script to add the sitepackages of my venv
import sys
sys.path.append(r'C:\Users\...\Desktop\Scripts\Temp_Projects\nimpy_test_venv_interop_10_06_2023-01_25PM\venv\Lib\site-packages')
from pyfiglet import Figlet
f = Figlet(font='slant')
def test():
print(f.renderText('text to render'))
from nimpy.
Related Issues (20)
- Codon
- have some trouble printing a module's version HOT 1
- keeping long lived objects alive from python HOT 2
- Import local py file HOT 2
- Nim 2.0 compatibility HOT 2
- [Bug] Using nim procedures as Python decorators is not working HOT 2
- How to unpack PPyObject (dict) to kwargs in Nim? HOT 1
- It is possible to call async function? HOT 1
- How to use python decorators HOT 1
- Error: type mismatch: nimpy.nim(223, 37) HOT 1
- undefined symbol: _PyModule_Add [Exception] HOT 3
- Nim Version 2.0 breaks (Mac) HOT 4
- Issue importing in windows HOT 8
- Examples do not compile - `type mismatch` HOT 1
- Python Command Line Arguments Disappearing HOT 1
- How to pass Windows data types like HWND & HBRUSH
- No way of initializing type with kwargs HOT 1
- Nimpy cannot import modules with default python 3.12 install on Windows 11
- __dict__ or __slots__ implementation
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.