Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

conda-unpack failed

See original GitHub issue

Issue Description

Steps to reproduce on the new machine:

$ mkdir antlr37
$ tar xzf antlr37.tar.gz -C antlr37
$ source antlr37/bin/activate
(antlr37) $ conda-unpack
Traceback (most recent call last):
  File "/users/certik/scratch1/pack/antlr37/bin/conda-unpack", line 408, in <module>
    placeholder, mode=mode)
  File "/users/certik/scratch1/pack/antlr37/bin/conda-unpack", line 66, in update_prefix
    with open(path, 'rb+') as fh:
OSError: [Errno 26] Text file busy: '/users/certik/scratch1/pack/antlr37/bin/python3.7'

I used the latest conda-pack available on conda forge.

I didn’t install Python nor conda on the target machine.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

jcristcommented, Oct 22, 2018

Apologies, I thought I’d already released those fixes. Up on pypi, will be on conda-forge once the build finishes. Thanks for the reminder!

jcristcommented, Sep 26, 2018

Odd. I have no issues running this on mac, but do on linux.

Environment created as conda create -n test python=3.7 toolz -y.

(test) jcrist conda-pack $ conda list
# packages in environment at /Users/jcrist/anaconda/envs/test:
# Name                    Version                   Build  Channel
ca-certificates           2018.03.07                    0
certifi                   2018.8.24                py37_1
libcxx                    4.0.1                h579ed51_0
libcxxabi                 4.0.1                hebd6815_0
libedit                   3.1.20170329         hb402a30_2
libffi                    3.2.1                h475c297_4
ncurses                   6.1                  h0a44026_0
openssl                   1.0.2p               h1de35cc_0
pip                       10.0.1                   py37_0
python                    3.7.0                hc167b69_0
readline                  7.0                  h1de35cc_5
setuptools                40.2.0                   py37_0
sqlite                    3.24.0               ha441bb4_0
tk                        8.6.8                ha441bb4_0
toolz                     0.9.0                    py37_0
wheel                     0.31.1                   py37_0
xz                        5.2.4                h1de35cc_4
zlib                      1.2.11               hf3cbc9b_2
(test) jcrist conda-pack $ source deactivate
jcrist conda-pack $ source activate conda-pack
(conda-pack) jcrist conda-pack $ conda-pack -n test -o test.tar
Collecting packages...
Packing environment at '/Users/jcrist/anaconda/envs/test' to 'test.tar'
[########################################] | 100% Completed |  1.3s
(conda-pack) jcrist conda-pack $ source deactivate
jcrist conda-pack $ mkdir out
jcrist conda-pack $ tar -xf test.tar -C out
jcrist conda-pack $ source out/bin/activate
(out) jcrist conda-pack $ conda-unpack
(out) jcrist conda-pack $ which python

I see a few options forward:

  • See if there’s a way to get around this on linux (initial googling didn’t turn anything up, but there may be something)
  • Skip rewriting the path in python. Only recent versions of python have an absolute path in the executable. This may or may not be necessary - if it’s not, then skipping python may be a valid solution.
  • Make the script move python temporarily, edit the moved python, then move it back. This would make the conda-unpack script a mix of shell and python, and seems much more fragile. I am not in favor of this option if the other 2 above are valid.
Read more comments on GitHub >

github_iconTop Results From Across the Web

conda-pack 0.7.0 documentation - GitHub Pages
Once an environment is unpacked and conda-unpack has been executed, it cannot be relocated. Re-applying conda-pack is unlikely to work. conda-pack is not...
Read more >
Troubleshooting — conda 22.11.1.post16+ce4e810c9 ...
Occasionally, an installed package becomes corrupted. Conda works by unpacking the packages in the pkgs directory and then hard-linking them to the environment....
Read more >
conda returns 'Solving environment: failed' - Stack Overflow
Navigate to your conda base environment, as given by conda info. Open the file lib/pythonX.Y/site-packages/conda/gateways/connection/
Read more >
PyCharm - Configure a conda virtual environment - JetBrains
Press Ctrl+Alt+S to open Settings/Preferences and go to Project: <project name> | Python Interpreter. Click the Add Interpreter link next to the list...
Read more >
conda-pack - PyPI
conda -pack is a command line tool for creating relocatable conda environments. This is useful for deploying code in a consistent environment, potentially...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found