Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python (busy) and nothing happens #41

Open
mosheliv opened this issue May 21, 2021 · 14 comments
Open

Python (busy) and nothing happens #41

mosheliv opened this issue May 21, 2021 · 14 comments

Comments

@mosheliv
Copy link

I am running nbterm with no parameters, has ipykernel installed, enter "print(100)" in a cell, esc, cntrl-e.
The status bar changes to "python3 (busy)" and I have to kill the process to get out.

Ubuntu 16.04

@davidbrochart
Copy link
Owner

Difficult to know what's going on, can you post the output of pip freeze?

@mosheliv
Copy link
Author

mosheliv commented May 23, 2021 via email

@davidbrochart
Copy link
Owner

When I run pip install requirements.txt with you file, I get:

pip install -r requirements.txt 
Collecting albumentations@ git+https://github.com/albumentations-team/albumentations@95a048d342cbe748e5acf15cb1a28611a6303885
  Cloning https://github.com/albumentations-team/albumentations (to revision 95a048d342cbe748e5acf15cb1a28611a6303885) to /tmp/pip-install-jez8a6dl/albumentations_80e3be882cbc423f9c02d99cd853a45a
  Running command git clone -q https://github.com/albumentations-team/albumentations /tmp/pip-install-jez8a6dl/albumentations_80e3be882cbc423f9c02d99cd853a45a
  Running command git rev-parse -q --verify 'sha^95a048d342cbe748e5acf15cb1a28611a6303885'
  Running command git fetch -q https://github.com/albumentations-team/albumentations 95a048d342cbe748e5acf15cb1a28611a6303885
  Running command git checkout -q 95a048d342cbe748e5acf15cb1a28611a6303885
Obtaining DCNv2 from git+https://github.com/lbin/DCNv2@711fe28bd775574c8ee0fb0ab13408ba1eeb9465#egg=DCNv2 (from -r requirements.txt (line 37))
  Cloning https://github.com/lbin/DCNv2 (to revision 711fe28bd775574c8ee0fb0ab13408ba1eeb9465) to ./src/dcnv2
  Running command git clone -q https://github.com/lbin/DCNv2 /home/david/tmp/src/dcnv2
  Running command git rev-parse -q --verify 'sha^711fe28bd775574c8ee0fb0ab13408ba1eeb9465'
  Running command git fetch -q https://github.com/lbin/DCNv2 711fe28bd775574c8ee0fb0ab13408ba1eeb9465
  Running command git checkout -q 711fe28bd775574c8ee0fb0ab13408ba1eeb9465
    ERROR: Command errored out with exit status 1:
     command: /home/david/mambaforge/envs/nbterm/bin/python3.9 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/david/tmp/src/dcnv2/setup.py'"'"'; __file__='"'"'/home/david/tmp/src/dcnv2/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 /tmp/pip-pip-egg-info-8pfkhwqz
         cwd: /home/david/tmp/src/dcnv2/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/david/tmp/src/dcnv2/setup.py", line 6, in <module>
        import torch
    ModuleNotFoundError: No module named 'torch'
    ----------------------------------------
WARNING: Discarding git+https://github.com/lbin/DCNv2@711fe28bd775574c8ee0fb0ab13408ba1eeb9465#egg=DCNv2. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Collecting efficientnet@ git+https://github.com/qubvel/efficientnet@8984e988ecccd9c3a15be2e793991845619a8a26
  Cloning https://github.com/qubvel/efficientnet (to revision 8984e988ecccd9c3a15be2e793991845619a8a26) to /tmp/pip-install-jez8a6dl/efficientnet_551027d1bee6487493c75c7515b47f6e
  Running command git clone -q https://github.com/qubvel/efficientnet /tmp/pip-install-jez8a6dl/efficientnet_551027d1bee6487493c75c7515b47f6e
  Running command git rev-parse -q --verify 'sha^8984e988ecccd9c3a15be2e793991845619a8a26'
  Running command git fetch -q https://github.com/qubvel/efficientnet 8984e988ecccd9c3a15be2e793991845619a8a26
Collecting pytorch-metric-learning@ git+https://github.com/KevinMusgrave/pytorch-metric-learning@dff4ae570db89dcb59a102f13f665502f9c1c7c6
  Cloning https://github.com/KevinMusgrave/pytorch-metric-learning (to revision dff4ae570db89dcb59a102f13f665502f9c1c7c6) to /tmp/pip-install-jez8a6dl/pytorch-metric-learning_01cadd23e1e546ae8a592605e8e468ea
  Running command git clone -q https://github.com/KevinMusgrave/pytorch-metric-learning /tmp/pip-install-jez8a6dl/pytorch-metric-learning_01cadd23e1e546ae8a592605e8e468ea
  Running command git rev-parse -q --verify 'sha^dff4ae570db89dcb59a102f13f665502f9c1c7c6'
  Running command git fetch -q https://github.com/KevinMusgrave/pytorch-metric-learning dff4ae570db89dcb59a102f13f665502f9c1c7c6
  Running command git checkout -q dff4ae570db89dcb59a102f13f665502f9c1c7c6
Collecting absl-py==0.11.0
  Downloading absl_py-0.11.0-py3-none-any.whl (127 kB)
     |████████████████████████████████| 127 kB 2.9 MB/s 
Collecting adabelief-tf==0.2.0
  Downloading adabelief_tf-0.2.0-py3-none-any.whl (6.4 kB)
ERROR: Could not find a version that satisfies the requirement afm-op==0.0.0 (from versions: none)
ERROR: No matching distribution found for afm-op==0.0.0

@mosheliv
Copy link
Author

mosheliv commented May 23, 2021 via email

@mtatton
Copy link

mtatton commented Jul 1, 2021

Hi, it's waste of time to try nbterm currently on anything else than python 3.9.3 (so far what I know). Your setup ought to be something like 3.7.3. The busy message has been here either on 3.7.3. I tried fresh machine on Debian 10.10 and installed python 3.9.3. After that the nbterm started to communicate with the kernel.

@dirkroorda
Copy link

I have the same phenomenon on 3.9.5

@davidbrochart
Copy link
Owner

I just tried with python 3.9.5 and it works fine:

mamba create -n nbterm python=3.9.5 ipykernel nbterm
conda activate nbterm
nbterm

@dirkroorda
Copy link

I'm on an up-to-date mac, with a python 3.9.5 from python.org, and having done a pip3 install nbterm and ipykernel. I can only say that nbterm does not work out of this box.

@davidbrochart
Copy link
Owner

Can you post the output of pip freeze?

@dirkroorda
Copy link

That's a rather personal question ...

@mtatton
Copy link

mtatton commented Jan 6, 2022

I found precise cause of this error. I tested my hypothesis and confirmed solution on Debian 10.10.
The reason why the nbterm freezes on machines with Python 3.7 is following.
When You list the kernels with:
jupyter kernelspec list
You get something like e.g.:
python3|/usr/local/share/jupyter/kernels/python3
When I looked into the file on Debian 10.10 (with Python 3.7)
there is following:
cat /usr/local/share/jupyter/kernels/python3/kernel.json
{
"argv": [
"python",
"-m",
"ipykernel_launcher",
"-f",
"{connection_file}"
],
...
etc.
That means on systems with Python 2.7 and 3.x the nbterm tries to run Python 2.7. And that's something that doesn't work. In my case I ran the nbterm by editing the python 3 krnel json and replace python in the argv section to python3. Afterwards I sucesfully ran the nbterm on python 3.7 distribution.
... afterwards:
cat /usr/local/share/jupyter/kernels/python3/kernel.json
{
"argv": [
"python3",
"-m",
"ipykernel_launcher",
... etc.

@abe-winter
Copy link

abe-winter commented Feb 4, 2022

ran into this as well -- on linux, apt install python-is-python3 resolved it for me

(probably by creating a python command)

@swetepete
Copy link

That fixed it for me as well (Ubuntu 22)

@mlongval
Copy link

mlongval commented Dec 6, 2022

I can report that on my Ubuntu 22.04 system the suggested:

apt install python-is-python3

allows me to run nbterm as expected.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants