The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

141034 (1) [Avatar] Offline
#1
from nlpia.data import kite_text


>>> from nlpia.data import kite_text
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/handlers.py", line 835, in _connect_unixsocket
self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/config.py", line 558, in configure
handler = self.configure_handler(handlers[name])
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/config.py", line 731, in configure_handler
result = factory(**kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/handlers.py", line 818, in __init__
self._connect_unixsocket(address)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/logging/handlers.py", line 846, in _connect_unixsocket
self.socket.connect(address)
FileNotFoundError: [Errno 2] No such file or directory

307321 (1) [Avatar] Offline
#2
I have created a PR to address this on OS/X https://github.com/totalgood/nlpia/pull/1 where the domain socket is ‘/var/run/syslog’ rather than where it is on Linux which is ‘/dev/log’ (https://docs.python.org/3/library/logging.handlers.html#sysloghandler)
243895 (1) [Avatar] Offline
#3

Hi,

I have the following error when trying to import the nlpia package using Windows :

from nlpia.data import kite_text, kite_history


AttributeError                            Traceback (most recent call last)
~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\logging\config.py in configure(self)
    557                     try:
--> 558                         handler = self.configure_handler(handlers[name])
    559                         handler.name = name

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\logging\config.py in configure_handler(self, config)
    730         try:
--> 731             result = factory(**kwargs)
    732         except TypeError as te:

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\logging\handlers.py in __init__(self, address, facility, socktype)
    810             try:
--> 811                 self._connect_unixsocket(address)
    812             except OSError:

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\logging\handlers.py in _connect_unixsocket(self, address)
    842             use_socktype = socket.SOCK_DGRAM
--> 843         self.socket = socket.socket(socket.AF_UNIX, use_socktype)
    844         try:

AttributeError: module 'socket' has no attribute 'AF_UNIX'

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-32-6c4bf3147277> in <module>()
----> 1 from nlpia.data import kite_text, kite_history
      2 # kite_intro = kite_text.lower() # "A kite is traditionally ..."

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\site-packages\nlpia\data\__init__.py in <module>()
      4 from builtins import *  # noqa
      5 
----> 6 from nlpia.data.loaders import get_data, read_csv, untar, no_tqdm, dropbox_basename, download, download_file, multifile_dataframe  # noqa
      7 
      8 __all__ = [s.strip() for s in 'get_data, read_csv, untar, no_tqdm, dropbox_basename, download, download_file, multifile_dataframe'.split(',')]

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\site-packages\nlpia\data\loaders.py in <module>()
      8 import json
      9 import requests
---> 10 from nlpia.constants import logging, DATA_PATH, BIGDATA_PATH
     11 
     12 from tqdm import tqdm

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\site-packages\nlpia\constants.py in <module>()
     55 }
     56 
---> 57 logging.config.dictConfig(LOGGING_CONFIG)
     58 logger = logging.getLogger(__name__)
     59 

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\logging\config.py in dictConfig(config)
    793 def dictConfig(config):
    794     """Configure logging using a dictionary."""
--> 795     dictConfigClass(config).configure()
    796 
    797 

~\AppData\Local\Continuum\Anaconda3\envs\nlp\lib\logging\config.py in configure(self)
    564                         else:
    565                             raise ValueError('Unable to configure handler '
--> 566                                              '%r: %s' % (name, e))
    567 
    568                 # Now do any that were deferred

ValueError: Unable to configure handler 'logging.handlers.SysLogHandler': module 'socket' has no attribute 'AF_UNIX'
hobs (58) [Avatar] Offline
#4
Thank you for the PR and Issue descriptions. We will do cross-platform testing and fix these bugs as we get closer to finishing the manuscript text.
hobs (58) [Avatar] Offline
#5
We've also created a conda package (conda install totalgood/nlpia) to help with errors like this. And this bug was also fixed for the pip install package.
ecorro (1) [Avatar] Offline
#6
I hit a similar error with python 3.6.3 |Intel Corporation| in Windows 10


Could you please help me?



>>> from nlpia.data.loaders import kite_text

---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
C:\IntelPython3\lib\logging\config.py in configure(self)
557 try:
--> 558 handler = self.configure_handler(handlers[name])
559 handler.name = name

C:\IntelPython3\lib\logging\config.py in configure_handler(self, config)
730 try:
--> 731 result = factory(**kwargs)
732 except TypeError as te:

TypeError: __init__() missing 1 required positional argument: 'appname'

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
<ipython-input-5-8e8dc0cc6f2d> in <module>()
----> 1 from nlpia.data.loaders import kite_text

~\downloads\nlpia\src\nlpia\data\__init__.py in <module>()
----> 1 from nlpia.loaders import * # noqa

~\downloads\nlpia\src\nlpia\loaders.py in <module>()
68 from pugnlp.futil import mkdir_p, path_status, find_files
69 from pugnlp.util import clean_columns
---> 70 from nlpia.constants import DATA_PATH, BIGDATA_PATH
71 from nlpia.constants import DATA_INFO_FILE, BIGDATA_INFO_FILE, BIGDATA_INFO_LATEST
72

~\downloads\nlpia\src\nlpia\constants.py in <module>()
89
90
---> 91 logging.config.dictConfig(LOGGING_CONFIG)
92 logger = logging.getLogger(__name__)
93

C:\IntelPython3\lib\logging\config.py in dictConfig(config)
793 def dictConfig(config):
794 """Configure logging using a dictionary."""
--> 795 dictConfigClass(config).configure()
796
797

C:\IntelPython3\lib\logging\config.py in configure(self)
564 else:
565 raise ValueError('Unable to configure handler '
--> 566 '%r: %s' % (name, e))
567
568 # Now do any that were deferred

ValueError: Unable to configure handler 'logging.handlers.NTEventLogHandler': __init__() missing 1 required positional argument: 'appname'