Hello Everyone ,
MY GOAL:
trying to add a custom c/c++ module into sp to later import in a script from..
STEPS TAKEN:
step1) aquired a .pyd file via anaconda of my desired module. ( anaconda = python distribution)
step2) putting the same ".pyd" into "csgo\addons\source-python\Python3\plat-win"
PROBLEM:
after starting my server the import command returns "ImportError: No module named 'x'"
my assumptions:
1) dependencies are missing, that were installed into anaconda == the whole method is flawed?
2) i have to register the module somewhere in sp
3) i have to use a special name syntax starting with "_"
is anybody familliar with this issue and wants to offer a solution?
thanks in advance
Adding Custom Modules
I moved this thread, because it's not a module/package submission.
site-packages should be placed here: https://github.com/Source-Python-Dev-Team/Source.Python/tree/master/addons/source-python/packages/site-packages
custom SP packages here: https://github.com/Source-Python-Dev-Team/Source.Python/tree/master/addons/source-python/packages/custom
Since you didn't tell us the name of the package and the original error message, this could be a possible issue.
No, its directory just needs to be in sys.path.
The name doesn't matter.
Which Python version is your anaconda distribution running? Source.Python currently runs with 3.4 (CPython).
D3CEPTION wrote:step2) putting the same ".pyd" into "csgo\addons\source-python\Python3\plat-win"
site-packages should be placed here: https://github.com/Source-Python-Dev-Team/Source.Python/tree/master/addons/source-python/packages/site-packages
custom SP packages here: https://github.com/Source-Python-Dev-Team/Source.Python/tree/master/addons/source-python/packages/custom
D3CEPTION wrote:1) dependencies are missing, that were installed into anaconda == the whole method is flawed?
Since you didn't tell us the name of the package and the original error message, this could be a possible issue.
D3CEPTION wrote:2) i have to register the module somewhere in sp
No, its directory just needs to be in sys.path.
D3CEPTION wrote:3) i have to use a special name syntax starting with "_"
The name doesn't matter.
Which Python version is your anaconda distribution running? Source.Python currently runs with 3.4 (CPython).
Ayuto wrote:site-packages should be placed here: https://github.com/Source-Python-Dev-Team/Source.Python/tree/master/addons/source-python/packages/site-packages
custom SP packages here: https://github.com/Source-Python-Dev-Team/Source.Python/tree/master/addons/source-python/packages/custom
i know about those, but do those work for adding dlls?
is the second one for dlls? im not familiar with this terminology.
is my "dll" a "package" in this context? ( language-wise module suits better)
Ayuto wrote:Which Python version is your anaconda distribution running? Source.Python currently runs with 3.4 (CPython).
im using 3.5, but my module uses a previous version, so i thought i should be fine?
thanks for helping!
D3CEPTION wrote:i know about those, but do those work for adding dlls?
is the second one for dlls?
Yes, it doesn't matter whether they are dll/pyd files or normal py files. The only thing that matters is that the containing directory is in sys.path (all of the three mentioned directories are in sys.path).
D3CEPTION wrote:is my "dll" a "package" in this context? ( language-wise module suits better)
Both is possible.
D3CEPTION wrote:im using 3.5, but my module uses a previous version, so i thought i should be fine?
Ideally, the module is compiled for CPython 3.4, because that's the version that Source.Python runs with.
Ayuto wrote:D3CEPTION wrote:1) dependencies are missing, that were installed into anaconda == the whole method is flawed?
Since you didn't tell us the name of the package and the original error message, this could be a possible issue.
Please tell me the original error message and the package/module name you are trying to import.
Edit: Just saw your update. Yes, 32bit!
okay i updated my modules env, its working now, thanks ayuto!
thats very easy, great i just imagined it to be harder to register modules/packages, therefor my confusion..
Yes, it doesn't matter whether they are dll/pyd files or normal py files. The only thing that matters is that the containing directory is in sys.path (all of the three mentioned directories are in sys.path).
thats very easy, great i just imagined it to be harder to register modules/packages, therefor my confusion..
Return to “General Discussion”
Who is online
Users browsing this forum: No registered users and 22 guests