Giter Club home page Giter Club logo

Comments (8)

yglukhov avatar yglukhov commented on June 9, 2024

Please make sure python and your dll's architectures match

from nimpy.

realratchet avatar realratchet commented on June 9, 2024

I'll check, but would there be any parameters to compile under different architecture? I assume it would default to same architecture as host. The machine that built it is the one attempting to import it.

from nimpy.

root-11 avatar root-11 commented on June 9, 2024

Please make sure python and your dll's architectures match

How do you recommend that I'd do that?

from nimpy.

realratchet avatar realratchet commented on June 9, 2024

Machine: x64
Python: x64
PYD: x64

from nimpy.

root-11 avatar root-11 commented on June 9, 2024

based on the instruction on troubleshooting-qa it also looks to me like the virtual environment isn't being read. e.g. nimpy uses default users venv instead.

from nimpy.

root-11 avatar root-11 commented on June 9, 2024

Can we fund somebody to get this issue dealt with?

from nimpy.

yglukhov avatar yglukhov commented on June 9, 2024

The first step would be to teach me to reproduce it. Provide smallest possible source code of app.nim and test.py. Describe your python installation, version, venv, etc. What are the paths to your pyd and main.py files. Windows version, nim version, mingw version. Whether you tried reinstalling all of it (surprisingly this helps quite often).

from nimpy.

realratchet avatar realratchet commented on June 9, 2024

I solved the issue that was plaguing Windows.

import nimpy
 
let
    builtins = pyBuiltinsModule() # specifically this line was problematic
    PyNoneClass = builtins.None.getattr("__class__")

proc isNone*(py: PyObject): bool {.inline.} =
    return builtins.isinstance(py, PyNoneClass).to(bool)

I tracked it down to this particular snippet and changed it to this

import nimpy

var
    isInit = false
    builtins: PyObject
    PyNoneClass: PyObject

proc isNone*(py: PyObject): bool {.inline.} =
    if not isInit:
        builtins = pyBuiltinsModule()
        PyNoneClass = builtins.None.getattr("__class__")
        isInit = true
    return builtins.isinstance(py, PyNoneClass).to(bool)

You may close the issue.

from nimpy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.