slynch8 / 10x

10x IDE/Editor
184 stars 33 forks source link

Python: No module named '_socket' #461

Open dragn opened 2 years ago

dragn commented 2 years ago

I want to use asyncio in my python script, but I get this if I import it:

[python]     import asyncio
[python]   File "asyncio\__init__.py", line 8, in <module>
[python]   File "asyncio\base_events.py", line 23, in <module>
[python]   File "socket.py", line 49, in <module>
[python] ModuleNotFoundError: No module named '_socket'
slynch8 commented 2 years ago

You should be able to add modules to the built in 10x python by putting them in the 10x install folder, and then restart 10x.

dragn commented 2 years ago

Hi Stewart, Thanks for quick response! I don't know much about python yet, but it looks like _socket is a platform-specific C extension that socket.py module relies on. Shouldn't it be included in the python distribution?

slynch8 commented 2 years ago

Yes, you're right. It looks like the installed python.zip doesn't contain any compiled pyd files. I'll see if I can find aa way around it.

slynch8 commented 2 years ago

I tried grabbing the pyd from my 3.7 install and putting it into the install folder but it crashes. I guess I'll have to compile it in to 10x somehow.

slynch8 commented 2 years ago

I'll be updating to 3.9 in the next few days and adding in the .pyd files