Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hebaoxing opened this issue Jan 5, 2017 · 17 comments

Comments

@hebaoxing
Copy link

hebaoxing commented Jan 5, 2017

@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!

@Ghostkeeper
Copy link
Contributor

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

@daid
Copy link
Contributor

daid commented Jan 5, 2017

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

@hebaoxing
Copy link
Author

hebaoxing commented Jan 6, 2017

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!

@daid
Copy link
Contributor

daid commented Jan 6, 2017

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.

@hebaoxing
Copy link
Author

hebaoxing commented Jan 7, 2017

@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!

@awhiemstra
Copy link
Contributor

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.

@hebaoxing
Copy link
Author

@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!

@awhiemstra
Copy link
Contributor

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.

@hebaoxing
Copy link
Author

@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.

@awhiemstra
Copy link
Contributor

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.

@hebaoxing
Copy link
Author

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:

@awhiemstra
Copy link
Contributor

awhiemstra commented Jan 9, 2017

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

@hebaoxing
Copy link
Author

hebaoxing commented Jan 9, 2017

"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
Copy link
Author

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

@Ghostkeeper
Copy link
Contributor

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

@hebaoxing
Copy link
Author

hebaoxing commented Jan 23, 2017

@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.

@akshayams94
Copy link

print(Arcus.file)

We need arcus file. Dont delete it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants