2

I am trying to install ibm_db_sa in my miniconda virtual environment (python 3.6). I am seeing this error and it could be because I am a separate user on my laptop and not the admin. Is there any solution/workaround this?

sudo pip install ibm_db_sa
Password:
WARNING: The directory '/Users/myname/Library/Caches/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting ibm_db_sa
  Downloading ibm_db_sa-0.3.7.tar.gz (30 kB)
Requirement already satisfied: sqlalchemy>=0.7.3 in /usr/local/Caskroom/miniconda/base/envs/finalenv/lib/python3.6/site-packages (from ibm_db_sa) (1.4.25)
Collecting ibm_db>=2.0.0
  Downloading ibm_db-3.0.4.tar.gz (796 kB)
     |████████████████████████████████| 796 kB 1.1 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/local/Caskroom/miniconda/base/envs/finalenv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-2fdrlxey/ibm-db_375dbdf21455451c871e608261014786/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-2fdrlxey/ibm-db_375dbdf21455451c871e608261014786/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/tmp/pip-pip-egg-info-jzevidp0
         cwd: /private/tmp/pip-install-2fdrlxey/ibm-db_375dbdf21455451c871e608261014786/
    Complete output (3 lines):
    Detected 64-bit Python
    Downloading https://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/macos64_odbc_cli.tar.gz
    error in ibm_db setup command: use_2to3 is invalid.
WARNING: Discarding https://files.pythonhosted.org/packages/b6/0c/a8d57078772abcc876f6a2be2252f12284aa6f71f41d3c2910f23369d7d2/ibm_db-2.0.6.1.tar.gz#sha256=bdc6543702e19d8ff7a0ddef715a9ee32a7753686cbcfe99095c2e357efe4135 (from https://pypi.org/simple/ibm-db/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  Downloading ibm_db-2.0.5.1.tar.gz (460 kB)
     |████████████████████████████████| 460 kB 1.1 MB/s 
ERROR: No .egg-info directory found in /private/tmp/pip-pip-egg-info-y8tp952r
x89
  • 2,798
  • 5
  • 46
  • 110
  • Have you tried an installation in your account? "pip --user install" – data_henrik Sep 29 '21 at 08:33
  • Not sure how that works. Can you explain? This command as it as doesn't work. Also, pip works for installing other libraries @data_henrik – x89 Sep 29 '21 at 08:36
  • That would install the tools in your account, not globally. I just checked the GitHub repo for the driver and found this: https://github.com/ibmdb/python-ibmdb/issues/653 It is a known issue with setuptools and being worked on. – data_henrik Sep 29 '21 at 08:46
  • https://stackoverflow.com/search?q=%5Bpip%5D+use_2to3+is+invalid – phd Sep 29 '21 at 10:43

1 Answers1

-1

The issue you ran into seems related to a problem with setuptools. See this issue in the GitHub repository for the ibm_db driver.

data_henrik
  • 16,724
  • 2
  • 28
  • 49