usc-isi-i2 / kgtk

Knowledge Graph Toolkit
https://kgtk.readthedocs.io/en/latest/
MIT License
358 stars 57 forks source link

multiple errors with local installation #504

Closed valecarriero closed 3 years ago

valecarriero commented 3 years ago

Describe the bug Errors during the local installation

To Reproduce Steps to reproduce the behavior:

conda create -n kgtk-env3.8 python=3.8
The following NEW packages will be INSTALLED:
  ca-certificates    pkgs/main/osx-64::ca-certificates-2021.7.5-hecd8cb5_1
  certifi            pkgs/main/osx-64::certifi-2021.5.30-py38hecd8cb5_0
  libcxx             pkgs/main/osx-64::libcxx-12.0.0-h2f01273_0
  libffi             pkgs/main/osx-64::libffi-3.3-hb1e8313_2
  ncurses            pkgs/main/osx-64::ncurses-6.2-h0a44026_1
  openssl            pkgs/main/osx-64::openssl-1.1.1l-h9ed2024_0
  pip                pkgs/main/osx-64::pip-21.2.2-py38hecd8cb5_0
  python             pkgs/main/osx-64::python-3.8.11-h88f2d9e_1
  readline           pkgs/main/osx-64::readline-8.1-h9ed2024_0
  setuptools         pkgs/main/osx-64::setuptools-58.0.4-py38hecd8cb5_0
  sqlite             pkgs/main/osx-64::sqlite-3.36.0-hce871da_0
  tk                 pkgs/main/osx-64::tk-8.6.11-h7bc2e8c_0
  wheel              pkgs/main/noarch::wheel-0.37.0-pyhd3eb1b0_1
  xz                 pkgs/main/osx-64::xz-5.2.5-h1de35cc_0
  zlib               pkgs/main/osx-64::zlib-1.2.11-h1de35cc_3
Proceed ([y]/n)? y

ERRORS: 1

Collecting demjson>=2.2.4
  Downloading demjson-2.2.4.tar.gz (131 kB)
     |████████████████████████████████| 131 kB 6.1 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /Users/vale/anaconda3/envs/kgtk-env3.8/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-j_aj7kcj/demjson_491bead929dc4dd7a9e8fec39eff6d7d/setup.py'"'"'; __file__='"'"'/private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-j_aj7kcj/demjson_491bead929dc4dd7a9e8fec39eff6d7d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-pip-egg-info-32r71fe_
         cwd: /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-j_aj7kcj/demjson_491bead929dc4dd7a9e8fec39eff6d7d/
    Complete output (1 lines):
    error in demjson setup command: use_2to3 is invalid.
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/96/67/6db789e2533158963d4af689f961b644ddd9200615b8ce92d6cad695c65a/demjson-2.2.4.tar.gz#sha256=31de2038a0fdd9c4c11f8bf3b13fe77bc2a128307f965c8d5fb4dc6d6f6beb79 (from https://pypi.org/simple/demjson/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

2

Collecting spacy==2.1.1
  Downloading spacy-2.1.1.tar.gz (27.7 MB)
     |████████████████████████████████| 27.7 MB 1.5 MB/s 
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/vale/anaconda3/envs/kgtk-env3.8/bin/python /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-standalone-pip-d0bi_qz5/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-build-env-q4q6zhxu/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0.<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.0.0.dev6
       cwd: None
  Complete output (1333 lines):
  Collecting setuptools
    Downloading setuptools-58.2.0-py3-none-any.whl (946 kB)
 [...]
    Compiler gcc
    building 'blis.cy' extension
    creating build/temp.macosx-10.9-x86_64-3.8
    creating build/temp.macosx-10.9-x86_64-3.8/blis
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/vale/anaconda3/envs/kgtk-env3.8/include -arch x86_64 -I/Users/vale/anaconda3/envs/kgtk-env3.8/include -arch x86_64 -I/private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-lfth9dyo/blis_68be5c5b3f3441c09146fcbe3979f3e3/include -I/private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-lfth9dyo/blis_68be5c5b3f3441c09146fcbe3979f3e3/blis/_src/include/darwin-x86_64 -I/Users/vale/anaconda3/envs/kgtk-env3.8/include/python3.8 -c blis/cy.c -o build/temp.macosx-10.9-x86_64-3.8/blis/cy.o -std=c99
    error: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.7" but "10.9" during configure
    ----------------------------------------
    ERROR: Failed building wheel for blis
    Running setup.py clean for blis
    Building wheel for thinc-gpu-ops (setup.py): started
    Building wheel for thinc-gpu-ops (setup.py): finished with status 'done'
    Created wheel for thinc-gpu-ops: filename=thinc_gpu_ops-0.0.4-py3-none-any.whl size=54967 sha256=7af9e1ffb964e36f4a90b6b2a0e2e0b375090f79cc72e946e54affde2751cf38
    Stored in directory: /Users/vale/Library/Caches/pip/wheels/68/e5/dd/5bfe0549c10cc1834a91d96aea12596f3ed8091e5ab0c5b500
    Building wheel for wrapt (setup.py): started
    Building wheel for wrapt (setup.py): finished with status 'done'
    Created wheel for wrapt: filename=wrapt-1.10.11-cp38-cp38-macosx_10_9_x86_64.whl size=32642 sha256=23447bb34f21c3b33550c044cdcccf5af4e478cd80b4508a3e6ccf75dd0211ab
    Stored in directory: /Users/vale/Library/Caches/pip/wheels/93/8e/c9/a18fa0021f99d9e55a3ce5f2adc4c14b1dd1cab385e6993e2b
  Successfully built thinc preshed thinc-gpu-ops wrapt
  Failed to build blis
  Installing collected packages: numpy, cymem, wrapt, wasabi, tqdm, thinc-gpu-ops, srsly, six, preshed, plac, murmurhash, blis, wheel, thinc, setuptools, Cython
      Running setup.py install for blis: started
      Running setup.py install for blis: still running...
      Running setup.py install for blis: still running...
      Running setup.py install for blis: still running...
      Running setup.py install for blis: still running...
      Running setup.py install for blis: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: /Users/vale/anaconda3/envs/kgtk-env3.8/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-lfth9dyo/blis_68be5c5b3f3441c09146fcbe3979f3e3/setup.py'"'"'; __file__='"'"'/private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-lfth9dyo/blis_68be5c5b3f3441c09146fcbe3979f3e3/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-record-99v1ojn2/install-record.txt --single-version-externally-managed --prefix /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-build-env-q4q6zhxu/overlay --compile --install-headers /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-build-env-q4q6zhxu/overlay/include/python3.8/blis
           cwd: /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-install-lfth9dyo/blis_68be5c5b3f3441c09146fcbe3979f3e3/
      Complete output (628 lines):
      BLIS_COMPILER? None
      running install
      running build
      running build_py
      creating build
      creating build/lib.macosx-10.9-x86_64-3.8
      creating build/lib.macosx-10.9-x86_64-3.8/blis
      copying blis/benchmark.py -> build/lib.macosx-10.9-x86_64-3.8/blis
      copying blis/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/blis
      copying blis/about.py -> build/lib.macosx-10.9-x86_64-3.8/blis
      creating build/lib.macosx-10.9-x86_64-3.8/blis/tests
      copying blis/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.8/blis/tests
      copying blis/tests/test_dotv.py -> build/lib.macosx-10.9-x86_64-3.8/blis/tests
      copying blis/tests/test_gemm.py -> build/lib.macosx-10.9-x86_64-3.8/blis/tests
      copying blis/tests/common.py -> build/lib.macosx-10.9-x86_64-3.8/blis/tests
      copying blis/cy.pyx -> build/lib.macosx-10.9-x86_64-3.8/blis
      copying blis/py.pyx -> build/lib.macosx-10.9-x86_64-3.8/blis
      copying blis/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.8/blis
      copying blis/cy.pxd -> build/lib.macosx-10.9-x86_64-3.8/blis
      running build_ext
      unix
      py_compiler gcc
      {'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:', 'HOSTTYPE': 'x86_64', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'LANG': 'C.UTF-8', 'OLDPWD': '/home/matt/repos/flame-blis', 'VIRTUAL_ENV': '/home/matt/repos/cython-blis/env3.6', 'USER': 'matt', 'PWD': '/home/matt/repos/cython-blis', 'HOME': '/home/matt', 'NAME': 'LAPTOP-OMKOB3VM', 'XDG_DATA_DIRS': '/usr/local/share:/usr/share:/var/lib/snapd/desktop', 'SHELL': '/bin/bash', 'TERM': 'xterm-256color', 'SHLVL': '1', 'LOGNAME': 'matt', 'PATH': '/home/matt/repos/cython-blis/env3.6/bin:/tmp/google-cloud-sdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/Users/matt/Documents/cmder/vendor/conemu-maximus5/ConEmu/Scripts:/mnt/c/Users/matt/Documents/cmder/vendor/conemu-maximus5:/mnt/c/Users/matt/Documents/cmder/vendor/conemu-maximus5/ConEmu:/mnt/c/Python37/Scripts:/mnt/c/Python37:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/iCLS:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/iCLS:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/DAL:/mnt/c/Program Files (x86)/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/Intel(R) Management Engine Components/IPT:/mnt/c/Program Files/Intel/WiFi/bin:/mnt/c/Program Files/Common Files/Intel/WirelessCommon:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/mnt/c/ProgramData/chocolatey/bin:/mnt/c/Program Files/Git/cmd:/mnt/c/Program Files/LLVM/bin:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Windows/System32/OpenSSH:/mnt/c/Program Files/nodejs:/mnt/c/Users/matt/AppData/Local/Microsoft/WindowsApps:/mnt/c/Users/matt/AppData/Local/Programs/Microsoft VS Code/bin:/mnt/c/Users/matt/AppData/Roaming/npm:/snap/bin:/mnt/c/Program Files/Oracle/VirtualBox', 'PS1': '(env3.6) \\[\\e]0;\\u@\\h: \\w\\a\\]${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]\\$ ', 'VAGRANT_HOME': '/home/matt/.vagrant.d/', 'LESSOPEN': '| /usr/bin/lesspipe %s', '_': '/home/matt/repos/cython-blis/env3.6/bin/python'}
      [...]
  ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/07/02/ef131c958721f46fa72915124e088364ba7696d2efd6d0e8f44b27250f17/spacy-2.1.1.tar.gz#sha256=809561162007bdda8a8a07cded52983e848b1a83de6dc3e8b025007bbcdb3994 (from https://pypi.org/simple/spacy/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*). Command errored out with exit status 1: /Users/vale/anaconda3/envs/kgtk-env3.8/bin/python /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-standalone-pip-d0bi_qz5/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /private/var/folders/hs/94ddj4xd0pv_wmllk9hpbv8c0000gn/T/pip-build-env-q4q6zhxu/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools 'wheel>0.32.0.<0.33.0' Cython 'cymem>=2.0.2,<2.1.0' 'preshed>=2.0.1,<2.1.0' 'murmurhash>=0.28.0,<1.1.0' thinc==7.0.0.dev6 Check the logs for full command output.

Desktop (please complete the following information):

Additional context

I also tried to downgrade setuptools as suggested in another issue

pip install setuptools==57.0.0
Collecting setuptools==57.0.0
  Downloading setuptools-57.0.0-py3-none-any.whl (821 kB)
     |████████████████████████████████| 821 kB 5.2 MB/s 
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 58.0.4
    Uninstalling setuptools-58.0.4:
      Successfully uninstalled setuptools-58.0.4
Successfully installed setuptools-57.0.0

pip freeze

attrs==21.2.0
blis==0.4.1
catalogue==1.0.0
certifi==2021.5.30
charset-normalizer==2.0.6
click==8.0.1
cloudpickle==2.0.0
cycler==0.10.0
cymem==2.0.5
Cython==0.29.24
dask==2021.9.1
dill==0.3.4
distributed==2021.9.1
etk==2.0.1
filelock==3.3.0
fsspec==2021.10.0
HeapDict==1.0.1
huggingface-hub==0.0.17
idna==3.2
iso-639==0.4.5
isodate==0.6.0
Jinja2==3.0.1
joblib==1.0.1
kgtk==0.2.1
kiwisolver==1.3.2
locket==0.2.1
loguru==0.5.3
lz4==3.1.3
MarkupSafe==2.0.1
matplotlib==3.4.3
msgpack==1.0.2
multiprocess==0.70.12.2
murmurhash==1.0.5
mypy==0.910
mypy-extensions==0.4.3
nltk==3.6.3
numpy==1.21.2
packaging==21.0
pandas==1.3.3
partd==1.2.0
Pillow==8.3.2
plac==1.1.3
preshed==3.0.5
psutil==5.8.0
pycountry==20.7.3
pyparsing==2.4.7
pyrallel.lib==0.0.10
python-dateutil==2.8.2
pytz==2021.3
PyYAML==5.4.1
rdflib==6.0.1
redis==3.5.3
regex==2021.9.30
requests==2.26.0
rfc3986==1.5.0
rltk==2.0.0a18
sacremoses==0.0.46
scikit-learn==1.0
scipy==1.7.1
seaborn==0.11.2
sentence-transformers==2.1.0
sentencepiece==0.1.96
sh==1.14.2
simplejson==3.17.5
six==1.16.0
sklearn==0.0
sortedcontainers==2.4.0
SPARQLWrapper==1.8.5
srsly==1.0.5
tblib==1.7.0
thinc==7.4.0
threadpoolctl==3.0.0
tokenizers==0.10.3
toml==0.10.2
toolz==0.11.1
torch==1.9.1
torchvision==0.10.1
tornado==6.1
tqdm==4.62.3
transformers==4.11.2
typing==3.7.4.3
typing-extensions==3.10.0.2
urllib3==1.26.7
wasabi==0.8.2
zict==2.0.0

kgtk -h

usage: kgtk [options] command [ / command]*

kgtk --- Knowledge Graph Toolkit

positional arguments:
  command
    add_id              Copy a KGTK file, adding ID values.
    cat                 Concatenate KGTK files.
    clean_data          Validate a KGTK file and output a clean copy: no
                        comments, whitespace lines, invalid lines, etc.
    compact             Copy a KGTK file compacting | lists.
    connected-components
                        Find connected components in a Graph.
    connected_components
                        Find connected components in a graph.
    expand              Copy a KGTK file expanding | lists.
    explode (denormalize_node2)
                        Copy a KGTK file, exploding one column (usualy node2)
                        into seperate columns for each subfield.
    export_gt           Export a KGTK file to Graph-tool format.
    export_neo4j        Exports data to Neo4J Cypher Query Language
                        statements.
    filter              Filter rows by subject, predicate, object values.
    generate_mediawiki_jsons
                        Generates mediawiki json responses from kgtk file
    generate_wikidata_triples
                        Generates wikidata triples from kgtk file
    graph_statistics    Import a CSV file in Graph-tool.
    gt_loader           Import a CSV file in Graph-tool.
    ifempty             Filter a KGTK file for empty fields.
    ifexists            Filter a KGTK file by matching records in a second
                        KGTK file.
    ifnotempty          Filter a KGTK file for nonempty fields.
    ifnotexists         Filter a KGTK file by not matching records in a second
                        KGTK file.
    implode             Copy a KGTK file, building one column (usualy node2)
                        from seperate columns for each subfield.
    import_conceptnet   Import ConceptNet into KGTK.
    import_ntriples     Import an ntriple file into KGTK file
    import_wikidata     Import an wikidata file into KGTK file
    join                Join two KGTK files
    lift                Lift labels from a KGTK file.
    md                  Convert a KGTK file to a GitHub Markdown Table.
    merge_identical_nodes
                        Merge identical nodes and deduplicate.
    reachable_nodes     Find reachable nodes in a graph.
    remove_columns      Remove columns from a file
    rename_columns      Rename KGTK file columns.
    sort                Sort file based on one or more columns
    text_embedding      Produce embedding vectors on given file's nodes.
    unique              Count unique values in a column.
    validate            Validate a KGTK file
    zconcat             Concatenate any mixture of plain or gzip/bzip2/xz-
                        compressed files

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show KGTK version number and exit.

shared optional arguments:
  --debug               enable debug mode
  --expert              enable expert mode

python -m spacy download en_core_web_sm

/Users/vale/anaconda3/envs/kgtk-env3.8/bin/python: No module named spacy
dgarijo commented 3 years ago

@valecarriero, we are updating the installation instructions to make sure these errors go away. We'll have more updates next week.

szeke commented 3 years ago

@valecarriero we are able to reproduce the problem, installation is broken for us too. @CraigMiloRogers is working to fix it.

CraigMiloRogers commented 3 years ago

@valecarriero We tracked t least part of the problem down. KGTK required ETK (one of our other projects), and ETK required demjson. demjson is unmaintained, and got left behind in the Python 2 to Python 3 migration.

We released a new version of ETK that doesn't use demjson.

I was able to install a fresh kgtk using:

conda create -n kgtk-env python=3.8
conda activate kgtk-env
conda install -c conda-forge graph-tool
pip --no-cache install -U kgtk
python -m spacy download en_core_web_sm

Please give this a try and report your results. We're here to help you. Thanks.

CraigMiloRogers commented 3 years ago

Another thing I did that might help:

pip install etk==2.2.8

This should come before the pip --no-cache install -U kgtk. It is possible that by installing ETK first, one should then use pip install -U kgtk.

valecarriero commented 3 years ago

Thank you! I tried this

conda create -n kgtk-env python=3.8
conda activate kgtk-env
conda install -c conda-forge graph-tool
pip --no-cache install -U kgtk
python -m spacy download en_core_web_sm

and it worked!

valecarriero commented 3 years ago

Should this command (from here) work

kgtk  --debug --timing --progress import-wikidata \
        -i wikidata-all-20200504.json.gz \
        --node nodefile.tsv \
        --edge edgefile.tsv \
        --qual qualfile.tsv \
        --use-mgzip-for-input True \
        --use-mgzip-for-output True \
        --use-shm True \
        --procs 6 \
        --mapper-batch-size 5 \
        --max-size-per-mapper-queue 3 \
        --single-mapper-queue True \
        --collect-results True \
        --collect-seperately True\
        --collector-batch-size 10 \
        --collector-queue-per-proc-size 3 \
        --progress-interval 500000 --fail-if-missing False

or not?

This is what I get

kgtk  --debug --timing --progress import-wikidata \
>         -i /Volumes/LaCie/wikidata_dump_json_29092021/latest-all.json.gz \
>         --node nodefile.tsv \
>         --edge edgefile.tsv \
>         --qual qualfile.tsv \
>         --use-mgzip-for-input True \
>         --use-mgzip-for-output True \
>         --use-shm True \
>         --procs 6 \
>         --mapper-batch-size 5 \
>         --max-size-per-mapper-queue 3 \
>         --single-mapper-queue True \
>         --collect-results True \
>         --collect-seperately True\
>         --collector-batch-size 10 \
>         --collector-queue-per-proc-size 3 \
>         --progress-interval 500000 --fail-if-missing False
kgtk import-wikidata version: 2021-02-24T21:11:49.602037+00:00#sgB3FM8zpy/0bbx1RwyRawYnB1spAUBS+FVVQBL8DtJVxXE8mYCTTLr2lHJqbKVe5fBPp+k5iQjTDmJ6GRVf8Q==
Starting main process (pid 22079).
Processing.
Processing wikidata file /Volumes/LaCie/wikidata_dump_json_29092021/latest-all.json.gz
Traceback (most recent call last):
  File "/Users/vale/anaconda3/envs/kgtk-env/lib/python3.8/site-packages/kgtk/cli/import_wikidata.py", line 2580, in run
    progress_startup(fd=input_f.fileno()) # Start the custom progress monitor.
  File "/Users/vale/anaconda3/envs/kgtk-env/lib/python3.8/site-packages/kgtk/cli_entry.py", line 70, in progress_startup
    _save_progress_command = sh.pv("-d {}:{}".format(pid, fd),
  File "/Users/vale/anaconda3/envs/kgtk-env/lib/python3.8/site-packages/sh.py", line 3672, in __getattr__
    return self.__env[name]
  File "/Users/vale/anaconda3/envs/kgtk-env/lib/python3.8/site-packages/sh.py", line 3457, in __getitem__
    raise CommandNotFound(k)
sh.CommandNotFound: pv

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/vale/anaconda3/envs/kgtk-env/lib/python3.8/site-packages/kgtk/exceptions.py", line 46, in __call__
    return_code = func(*args, **kwargs) or 0
  File "/Users/vale/anaconda3/envs/kgtk-env/lib/python3.8/site-packages/kgtk/cli/import_wikidata.py", line 3028, in run
    raise KGTKException(str(e))
kgtk.exceptions.KGTKException: pv
pv
Timing: elapsed=0:00:00.472186 CPU=0:00:00.329380 ( 69.8%): import-wikidata -i /Volumes/LaCie/wikidata_dump_json_29092021/latest-all.json.gz --node nodefile.tsv --edge edgefile.tsv --qual qualfile.tsv --use-mgzip-for-input True --use-mgzip-for-output True --use-shm True --procs 6 --mapper-batch-size 5 --max-size-per-mapper-queue 3 --single-mapper-queue True --collect-results True --collect-seperately True --collector-batch-size 10 --collector-queue-per-proc-size 3 --progress-interval 500000 --fail-if-missing False
dgarijo commented 3 years ago

Hi @valecarriero, yes, it should work. I used it extensively in the past, successfully. This may be an error introduced by the latest changes. @CraigMiloRogers may know more.

CraigMiloRogers commented 3 years ago

The problem is the --progress option. It expects the pv system command to be installed.

dgarijo commented 3 years ago

Then we should list it as a requirement :S

CraigMiloRogers commented 3 years ago

I plan to have the code check if it exists and ignore --progress if it does not.

CraigMiloRogers commented 3 years ago

I've committed a change to our dev branch such that if the pv command is not available, then --progress will be silently ignored. I'd prefer to give a warning message when --debug is also specified, that will be a new issue.

CraigMiloRogers commented 3 years ago

@valecarriero Either drop the --progress option from the command line, or get the latest code from the KGTK GitHub repository.

CraigMiloRogers commented 3 years ago

I'm closing this issue, assuming that the thumbs-up emoji means the problems have been solved.