dnanexus / dx-toolkit

DNAnexus platform client libraries
http://autodoc.dnanexus.com/
Apache License 2.0
90 stars 85 forks source link

0.276: source environment - not able to import argcomplete #488

Open sgaj opened 5 years ago

sgaj commented 5 years ago

Hello,

Unpacking and sourcing the environment of dx-toolkit-v0.276.0-centos-amd64.tar.gz gave the following error (Python 2.7.5):

Traceback (most recent call last):
  File "./dx-toolkit/bin/register-python-argcomplete", line 23, in "module>
    import argcomplete
ImportError: No module named argcomplete

Resolved this by copying the argcomplete folder from ./dx-toolkit/share/dnanexus/lib/python2.7/site-packages/ to ./dx-toolkit/share/dnanexus/lib/python2.7/site-packages/dxpy/packages/

Unsure if this also affects other OSes.

amanda-hi commented 5 years ago

Was also having this problem with MacOS, thanks so much for sharing! After implementing the fix, though, I got the following error when trying to source the dx-toolkit tar archive again:

ImportError: No module named dxpy.scripts.dx

Not sure why I'm having so many issues finding the necessary scripts/modules?

EDIT: Answered my own question, had to switch over from python3.6 to python2.7 and everything is working now! Should have known.

radlinsky commented 5 years ago

On Linux, I saw the same error when I tried sourcing the environemnt: ImportError: No module named argcomplete

I was in a python3 virtual env, and here is what I did to fix the problem: 1) source /path/to/python3/env/bin/activate 2) pip install argcomplete 3) pip install dxpy 4) run the following to determine the path to python: which python 5) Copied the path (replacing tilde with absolute path), and used this path to replace the shebang (top line) in the following files: dx-toolkit/bin/dx dx-toolkit/bin/register-python-argcomplete

Ikayanjoh commented 4 years ago

May I request some help here! I did follow above instruction on how to install dx-toolkit but still getting same error.

$ tar -xzf dx-toolkit-v0.289.1-centos-amd64.tar.gz $ source dx-toolkit/environment

Traceback (most recent call last): File "./dx-toolkit/bin/register-python-argcomplete", line 27, in "module> import argcomplete ImportError: No module named argcomplete_

Am I missing anything?

japacheco42 commented 4 years ago

I also tried all of the above & still get same error, in Linux, verified using Python 2.7. Any other suggestions? The (argcomplete & dxpy) packages appear to be actually installed, when I tried pip install argcomplete (or dxpy) I get message back: Requirement already satisfied: argcomplete in ...../software/anaconda2/lib/python2.7/site-packages (1.0.0) & similar messages for dxpy, although that also gives errors/warnings such as "oncotator 1.9.8.0 has requirement numpy==1.11.0, but you'll have numpy 1.14.0 which is incompatible."

xihaoli commented 3 years ago

On Linux, I saw the same error when I tried sourcing the environemnt: ImportError: No module named argcomplete

I was in a python3 virtual env, and here is what I did to fix the problem:

  1. source /path/to/python3/env/bin/activate
  2. pip install argcomplete
  3. pip install dxpy
  4. run the following to determine the path to python: which python
  5. Copied the path (replacing tilde with absolute path), and used this path to replace the shebang (top line) in the following files: dx-toolkit/bin/dx dx-toolkit/bin/register-python-argcomplete

Thank you so much for the solution!!!