libArcus icon indicating copy to clipboard operation
libArcus copied to clipboard

AttributeError: module 'Arcus' has no attribute 'SocketListener' on windows

Open hebaoxing opened this issue 8 years ago • 17 comments
trafficstars

@Ghostkeeper @daid @fabianrodrigo

i'am also encountering the issue "No attribute SocketListener". and commands:

python3.5
import Arcus
print(Arcus.__file__)

get: somethingsomething/python3.5/lib/site-packages/Arcus/init.py

the big trouble for me is: i don't know how to build the libArcus on the windows, so the file Arcus.pyd can't be generated out. when i follows the build guidelines about Arcus on the webpage, also guideline about protobuf, they are no effective when i try to compile or install, every compile path is full of errors.

Could you point me out more detailed compile or install procedures? many thanks!

hebaoxing avatar Jan 05 '17 13:01 hebaoxing

Calling on @awhiemstra also... I have no clue about this.

Ghostkeeper avatar Jan 05 '17 15:01 Ghostkeeper

I've seen this when mixing wrong (old) versions of Arcus with newer Cura versions. Where older Arcus was wrongly in my path.

daid avatar Jan 05 '17 16:01 daid

thanks for the replies! @Ghostkeeper @daid

@daid Is there something i can do to build Cura smoothly with Arcus? or the newer version Arcus is a must? and where i can get the newer version Arcus? thanks!

hebaoxing avatar Jan 06 '17 01:01 hebaoxing

The newer version of Arcus is here in this repo, but if you installed an older version in your python installation, then the newer version does not properly override this.

daid avatar Jan 06 '17 07:01 daid

@daid
based this repo, the newer version Arcus, now i can get Arcus.pyd built by VS2015. i copy the file Arcus.pyd and Arcus folder(including init.py, *.sip files) to the python folder ..\Lib\site-packages, then do 1) python; 2)import Arcus; 3)print(Arcus.file); get: ..\Lib\site-packages\Arcus_init_.py.

is there something wrong about what i do ? install Arcus means what operations? thanks!

hebaoxing avatar Jan 07 '17 05:01 hebaoxing

You only need the .pyd file. The other files are leftovers that should have been removed a long time ago. I just removed them.

The .pyd should be placed somewhere where your Python can find it, either by setting PYTHONPATH or by manually copying the file.

awhiemstra avatar Jan 09 '17 10:01 awhiemstra

@awhiemstra @daid

i copy the .pyd file to the python folder ..\Lib\site-packages, and set PYTHONPATH to ..\Lib\site-packages, but when i build the cura project, the error"AttributeError: module 'Arcus' has no attribute 'SocketListener'" still appears, how can i solve this error? thanks!

hebaoxing avatar Jan 09 '17 12:01 hebaoxing

Make sure there is no "Arcus" directory in any of the PYTHONPATH directories. Python will try and load that directory before loading the .pyd file and then fail because the old Python implementation does not match the newer API.

awhiemstra avatar Jan 09 '17 12:01 awhiemstra

@awhiemstra

Arcus is not in any of the PYTHONPATH directories, just copy the .pyd file to the python folder.

I put the UM and Arcus folder in the cura project, if not, the compile will not find module Arcus and UM. but still can't avoid the error "AttributeError: module 'Arcus' has no attribute 'SocketListener'". it seems the compiler is not easy to find the SocketListener in every kind of try.

hebaoxing avatar Jan 09 '17 13:01 hebaoxing

In that case, it is finding the Arcus folder in the Cura folder. You need to remove that one and make sure the only Arcus thing Python can find is Arcus.pyd.

awhiemstra avatar Jan 09 '17 13:01 awhiemstra

i remove the Arcus folder, but the UM can't find it.

SingalSocket.py in the UM folder import Arcus

errors: ... cura.CrashHandler.show [35]: "../CuraMaster\UM\Backend\SignalSocket.py", line 4, in cura.CrashHandler.show [35]: import Arcus cura.CrashHandler.show [35]: ImportError: DLL load failed:

hebaoxing avatar Jan 09 '17 13:01 hebaoxing

The "DLL load failed" is the relevant message here. For some reason, the .pyd fails to load. Please post the entire stack trace.

awhiemstra avatar Jan 09 '17 14:01 awhiemstra

"C:\Python 3.5\python.exe" "C:\Program Files (x86)\JetBrains\PyCharm 2016.3\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 7256 --file D:/XProject/Cura/20170102/CuraMaster/cura_app.py pydev debugger: process 1052 is connecting

Connected to pydev debugger (build 163.8233.8) cura.CrashHandler.show [32]: An uncaught exception has occurred! cura.CrashHandler.show [35]: Traceback (most recent call last): cura.CrashHandler.show [35]: File "C:\Program Files (x86)\JetBrains\PyCharm 2016.3\helpers\pydev\pydevd.py", line 1596, in cura.CrashHandler.show [35]: globals = debugger.run(setup['file'], None, None, is_module) cura.CrashHandler.show [35]: File "C:\Program Files (x86)\JetBrains\PyCharm 2016.3\helpers\pydev\pydevd.py", line 974, in run cura.CrashHandler.show [35]: pydev_imports.execfile(file, globals, locals) # execute the script cura.CrashHandler.show [35]: File "C:\Program Files (x86)\JetBrains\PyCharm 2016.3\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile cura.CrashHandler.show [35]: exec(compile(contents+"\n", file, 'exec'), glob, loc) cura.CrashHandler.show [35]: File "D:/XProject/Cura/20170102/CuraMaster/cura_app.py", line 49, in cura.CrashHandler.show [35]: import cura.CuraApplication cura.CrashHandler.show [35]: File "D:/XProject/Cura/20170102/CuraMaster\cura\CuraApplication.py", line 4, in cura.CrashHandler.show [35]: from UM.Qt.QtApplication import QtApplication cura.CrashHandler.show [35]: File "C:\Python 3.5\lib\site-packages\UM\Qt\QtApplication.py", line 17, in cura.CrashHandler.show [35]: from UM.Qt.Bindings.Bindings import Bindings cura.CrashHandler.show [35]: File "C:\Python 3.5\lib\site-packages\UM\Qt\Bindings\Bindings.py", line 13, in cura.CrashHandler.show [35]: from . import BackendProxy cura.CrashHandler.show [35]: File "C:\Python 3.5\lib\site-packages\UM\Qt\Bindings\BackendProxy.py", line 9, in cura.CrashHandler.show [35]: from UM.Backend.Backend import BackendState cura.CrashHandler.show [35]: File "C:\Python 3.5\lib\site-packages\UM\Backend\Backend.py", line 6, in cura.CrashHandler.show [35]: from UM.Backend.SignalSocket import SignalSocket cura.CrashHandler.show [35]: File "C:\Python 3.5\lib\site-packages\UM\Backend\SignalSocket.py", line 4, in cura.CrashHandler.show [35]: import Arcus cura.CrashHandler.show [35]: ImportError: DLL load failed: The specified module could not be found。

Process finished with exit code 1

hebaoxing avatar Jan 09 '17 14:01 hebaoxing

@awhiemstra is there some idea about entire stack? i can't still find some solution about this issue.

hebaoxing avatar Jan 13 '17 02:01 hebaoxing

The module is not in the .pyd file or something? :confused:

Ghostkeeper avatar Jan 22 '17 13:01 Ghostkeeper

@Ghostkeeper thanks! the Arcus.pyd file is successfully compiled out. i copy the .pyd file to the python folder ..\Lib\site-packages, the Arcus module should be in the *.pyd file, but i have no tool to check. i think it seems Cura can't find the .pyd file.

if there is a fool-style way for the cura to link Arcus, the third party developer don't need to care the setting or install, it will be better.

hebaoxing avatar Jan 23 '17 02:01 hebaoxing

print(Arcus.file)

We need arcus file. Dont delete it

akshayams94 avatar Dec 19 '22 21:12 akshayams94