enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.32k stars 285 forks source link

AttributeError: module 'socket' has no attribute 'AF_INET' #525

Closed webMing closed 7 years ago

webMing commented 7 years ago

from tvtk.tools import tvtk_doc tvtk_doc.main() Traceback (most recent call last): File "", line 1, in File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/mayavi-4.5.0-py3.5-macosx-10.6-x86_64.egg/tvtk/tools/tvtk_doc.py", line 403, in main s.configure_traits() File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traits/has_traits.py", line 2172, in configure_traits kind, handler, id, scrollable, args ) File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/qt4/toolkit.py", line 213, in view_application id, scrollable, args ) File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/qt4/view_application.py", line 83, in view_application scrollable, args ).ui.result File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/qt4/view_application.py", line 134, in init args = self.args ) File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/view.py", line 433, in ui ui.ui( parent, kind ) File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/ui.py", line 222, in ui self.rebuild( self, parent ) File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/qt4/toolkit.py", line 154, in ui_live from . import ui_live File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/qt4/ui_live.py", line 28, in from .ui_panel \ File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/site-packages/traitsui/qt4/ui_panel.py", line 19, in import cgi File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/cgi.py", line 39, in from email.parser import FeedParser File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/email/parser.py", line 12, in from email.feedparser import FeedParser, BytesFeedParser File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/email/feedparser.py", line 27, in from email import message File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/email/message.py", line 16, in from email import utils File "/Users/apple/anaconda/envs/python3.5/lib/python3.5/email/utils.py", line 29, in import socket File "/Users/apple/socket.py", line 4, in s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) AttributeError: module 'socket' has no attribute 'AF_INET'

anyone encounter this problem ? and how to resolve it, great thank;

traits 4.6.0 vtk 7.0.0 traitsui 5.1.0
pyqt 4.11.4
python 3.5.3
qt 4.8.7 pyface 5.1.0

webMing commented 7 years ago

import socket File "/Users/apple/socket.py", line 4, in s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) AttributeError: module 'socket' has no attribute 'AF_INET' from this message , when i remove socket.py file in /Users/apple/socket.p this works well

irazirfan commented 4 years ago

try renaming the file to mysocket.py, that most likely gonna work https://stackoverflow.com/questions/14755963/websocket-server-in-python-module-object-has-no-attribute-af-inet/14756156#14756156

hunanhunan163 commented 10 months ago

try renaming the file to mysocket.py, that most likely gonna work尝试将文件重命名为mysocket.py,这很可能会起作用 https://stackoverflow.com/questions/14755963/websocket-server-in-python-module-object-has-no-attribute-af-inet/14756156#14756156

thank you,very much