Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Cannot import custom F# library to Python#1778

Unanswered
lHeidbreder asked this question inQ&A
Discussion options

Environment

  • Pythonnet version: 3.0.0a2
  • Python version: 3.10
  • Operating System: Win10
  • .NET Runtime: 6.0

Details

I created an F# library and was trying to use a method in python. I'm running into trouble even importing my module.

F# library consists of one file, looking like this:

module TestModule =    let test =        12

And the failing Python code looks like this:

sys.path.append(r"C:\Users\David\source\repos\FSTestLib\FSTestLib\bin\Debug\net6.0")import clrclr.AddReference("FSTestLib")import FSTestLib#import TestModule

I have tried uncommenting either one of the bottom two lines, always failing with a similar traceback, as seen below. The module name obviously depends on the line of code that is active when executing.

  File "<executing directory>\pynet_test.py", line 6, in <module>    import FSTestLibModuleNotFoundError: No module named 'FSTestLib'
You must be logged in to vote

Replies: 2 comments

Comment options

Having a similar issue.

You must be logged in to vote
0 replies
Comment options

I had a similar issue with a C# assembly too. Have you tried adding<Platforms>x64</Platforms> to your csproj file or whatever is the equivalent in F#. That solved it for me

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
3 participants
@lHeidbreder@richClubb@TonyCongqianWang
Converted from issue

This discussion was converted from issue #1777 on April 28, 2022 12:35.


[8]ページ先頭

©2009-2025 Movatter.jp