jaberg / skdata

Data sets for machine learning in Python
http://jaberg.github.com/skdata/
472 stars 149 forks source link

Support for Python 3.x #63

Open ziyuang opened 10 years ago

ziyuang commented 10 years ago

Currently skdata is not working with 2to3: installing from pip3 install skdata will get an error:

RefactoringTool: Can't open /tmp/pip_build_root/skdata/build/py3k: [Errno 2]
No such file or directory: '/tmp/pip_build_root/skdata/build/py3k'
lmarti commented 9 years ago

+1 Update: checking out the repo and doing a python setup.py install does work in python 3.

jskDr commented 8 years ago

Yes, it works. But, why isn't it yet woking by pip3?

williamcodes commented 7 years ago

I'm seeing a similar problem, skdata won't pip install with python3. Here's my error output:

$ pip install skdata
Collecting skdata
  Using cached skdata-0.0.4.tar.gz
    Complete output from command python setup.py egg_info:
    RefactoringTool: Skipping optional fixer: buffer
    RefactoringTool: Skipping optional fixer: idioms
    RefactoringTool: Skipping optional fixer: set_literal
    RefactoringTool: Skipping optional fixer: ws_comma
    RefactoringTool: Can't open /private/var/folders/b_/v88qj4rx52z9mmx67tlwkcpm0000gn/T/pip-build-_q95pm4w/skdata/build/py3k: [Errno 2] No such file or directory: '/private/var/folders/b_/v88qj4rx52z9mmx67tlwkcpm0000gn/T/pip-build-_q95pm4w/skdata/build/py3k'
    RefactoringTool: No files need to be modified.
    RefactoringTool: There was 1 error:
    RefactoringTool: Can't open /private/var/folders/b_/v88qj4rx52z9mmx67tlwkcpm0000gn/T/pip-build-_q95pm4w/skdata/build/py3k: [Errno 2] No such file or directory: '/private/var/folders/b_/v88qj4rx52z9mmx67tlwkcpm0000gn/T/pip-build-_q95pm4w/skdata/build/py3k'
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/b_/v88qj4rx52z9mmx67tlwkcpm0000gn/T/pip-build-_q95pm4w/skdata/setup.py", line 64, in <module>
        raise Exception('2to3 failed, exiting ...')
    Exception: 2to3 failed, exiting ...
    Copying source tree into build/py3k for 2to3 transformation...
    Converting to Python3 via 2to3...

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/b_/v88qj4rx52z9mmx67tlwkcpm0000gn/T/pip-build-_q95pm4w/skdata/
brunialti commented 7 years ago

I cannot use setup.py in windows to install skdata:

Microsoft Windows [Versione 10.0.14393]
(c) 2016 Microsoft Corporation. Tutti i diritti sono riservati.

C:\WINDOWS\system32>python d:\setup.py install
Copying source tree into build/py3k for 2to3 transformation...
Traceback (most recent call last):
  File "d:\setup.py", line 54, in <module>
    ignore=shutil.ignore_patterns('build', '.git'))
  File "C:\Program Files\Anaconda3\lib\shutil.py", line 353, in copytree
    raise Error(errors)
shutil.Error: [('.\\config\\BBI', 'd:\\build\\py3k\\config\\BBI', "[Errno 13] Permission denied: '.\\\\config\\\\BBI'"), ('.\\config\\BBI.LOG1', 'd:\\build\\py3k\\config\\BBI.LOG1', "[Errno 13] Permission denied: '.\\\\config\\\\BBI.LOG1'"), ('.\\config\\BBI.LOG2', 'd:\\build\\py3k\\config\\BBI.LOG2', "[Errno 13] Permission denied: '.\\\\config\\\\BBI.LOG2'"), ('.\\config\\DEFAULT', 'd:\\build\\py3k\\config\\DEFAULT', "[Errno 13] Permission denied: '.\\\\config\\\\DEFAULT'"), ('.\\config\\DEFAULT.LOG1', 'd:\\build\\py3k\\config\\DEFAULT.LOG1', "[Errno 13] Permission denied: '.\\\\config\\\\DEFAULT.LOG1'"), ('.\\config\\DEFAULT.LOG2', 'd:\\build\\py3k\\config\\DEFAULT.LOG2', "[Errno 13] Permission denied: '.\\\\config\\\\DEFAULT.LOG2'"), ('.\\config\\RegBack\\DEFAULT', 'd:\\build\\py3k\\config\\RegBack\\DEFAULT', "[Errno 13] Permission denied: '.\\\\config\\\\RegBack\\\\DEFAULT'"), ('.\\config\\RegBack\\SAM', 'd:\\build\\py3k\\config\\RegBack\\SAM', "[Errno 13] Permission denied: '.\\\\config\\\\RegBack\\\\SAM'"), ('.\\config\\RegBack\\SECURITY', 'd:\\build\\py3k\\config\\RegBack\\SECURITY', "[Errno 13] Permission denied: '.\\\\config\\\\RegBack\\\\SECURITY'"), ('.\\config\\RegBack\\SOFTWARE', 'd:\\build\\py3k\\config\\RegBack\\SOFTWARE', "[Errno 13] Permission denied: '.\\\\config\\\\RegBack\\\\SOFTWARE'"), ('.\\config\\RegBack\\SYSTEM', 'd:\\build\\py3k\\config\\RegBack\\SYSTEM', "[Errno 13] Permission denied: '.\\\\config\\\\RegBack\\\\SYSTEM'"), ('.\\config\\SAM', 'd:\\build\\py3k\\config\\SAM', "[Errno 13] Permission denied: '.\\\\config\\\\SAM'"), ('.\\config\\SAM.LOG1', 'd:\\build\\py3k\\config\\SAM.LOG1', "[Errno 13] Permission denied: '.\\\\config\\\\SAM.LOG1'"), ('.\\config\\SAM.LOG2', 'd:\\build\\py3k\\config\\SAM.LOG2', "[Errno 13] Permission denied: '.\\\\config\\\\SAM.LOG2'"), ('.\\config\\SECURITY', 'd:\\build\\py3k\\config\\SECURITY', "[Errno 13] Permission denied: '.\\\\config\\\\SECURITY'"), ('.\\config\\SECURITY.LOG1', 'd:\\build\\py3k\\config\\SECURITY.LOG1', "[Errno 13] Permission denied: '.\\\\config\\\\SECURITY.LOG1'"), ('.\\config\\SECURITY.LOG2', 'd:\\build\\py3k\\config\\SECURITY.LOG2', "[Errno 13] Permission denied: '.\\\\config\\\\SECURITY.LOG2'"), ('.\\config\\SOFTWARE', 'd:\\build\\py3k\\config\\SOFTWARE', "[Errno 13] Permission denied: '.\\\\config\\\\SOFTWARE'"), ('.\\config\\SOFTWARE.LOG1', 'd:\\build\\py3k\\config\\SOFTWARE.LOG1', "[Errno 13] Permission denied: '.\\\\config\\\\SOFTWARE.LOG1'"), ('.\\config\\SOFTWARE.LOG2', 'd:\\build\\py3k\\config\\SOFTWARE.LOG2', "[Errno 13] Permission denied: '.\\\\config\\\\SOFTWARE.LOG2'"), ('.\\config\\SYSTEM', 'd:\\build\\py3k\\config\\SYSTEM', "[Errno 13] Permission denied: '.\\\\config\\\\SYSTEM'"), ('.\\config\\SYSTEM.LOG1', 'd:\\build\\py3k\\config\\SYSTEM.LOG1', "[Errno 13] Permission denied: '.\\\\config\\\\SYSTEM.LOG1'"), ('.\\config\\SYSTEM.LOG2', 'd:\\build\\py3k\\config\\SYSTEM.LOG2', "[Errno 13] Permission denied: '.\\\\config\\\\SYSTEM.LOG2'"), ('.\\config\\systemprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content.IE5', 'd:\\build\\py3k\\config\\systemprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Content.IE5', "[WinError 5] Accesso negato: '.\\\\config\\\\systemprofile\\\\AppData\\\\Local\\\\Microsoft\\\\Windows\\\\INetCache\\\\Content.IE5'"), ('.\\config\\systemprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Low\\Content.IE5', 'd:\\build\\py3k\\config\\systemprofile\\AppData\\Local\\Microsoft\\Windows\\INetCache\\Low\\Content.IE5', "[WinError 5] Accesso negato: '.\\\\config\\\\systemprofile\\\\AppData\\\\Local\\\\Microsoft\\\\Windows\\\\INetCache\\\\Low\\\\Content.IE5'"), ('.\\config\\systemprofile\\AppData\\Local\\Microsoft\\Windows\\Notifications\\WPNPRMRY.tmp', 'd:\\build\\py3k\\config\\systemprofile\\AppData\\Local\\Microsoft\\Windows\\Notifications\\WPNPRMRY.tmp', "[Errno 13] Permission denied: '.\\\\config\\\\systemprofile\\\\AppData\\\\Local\\\\Microsoft\\\\Windows\\\\Notifications\\\\WPNPRMRY.tmp'"), ('.\\LogFiles\\WMI\\RtBackup', 'd:\\build\\py3k\\LogFiles\\WMI\\RtBackup', "[WinError 5] Accesso negato: '.\\\\LogFiles\\\\WMI\\\\RtBackup'")]
JordanRushing commented 7 years ago

I was able to successfully install skdata with python 3 by checking-out the repo and placing the /skdata/skdata/ directory in the /usr/lib/python3.6/site-packages/ directory.

When using skdata for a neural network model that recognizes MNIST digits, a few compatability changes had to be made including adding from urllib.request import urlopen to /MNIST/dataset.py and correcting print statements for python3 in both dataset.py and base.py

edit: I have submitted a pull-request to integrate the print statement updates