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 'socket' has no attribute 'AF_INET' #525

Closed
webMing opened this issue Jul 12, 2017 · 3 comments
Closed

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

webMing opened this issue Jul 12, 2017 · 3 comments

Comments

@webMing
Copy link

webMing commented Jul 12, 2017

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

webMing commented Jul 12, 2017

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

@webMing webMing closed this as completed Jul 12, 2017
@irazirfan
Copy link

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

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

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

No branches or pull requests

3 participants