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

ic Error: Failed to access the underlying source code for analysis. #79

Closed
rnoxy opened this issue Apr 21, 2021 · 47 comments
Closed

ic Error: Failed to access the underlying source code for analysis. #79

rnoxy opened this issue Apr 21, 2021 · 47 comments

Comments

@rnoxy
Copy link

rnoxy commented Apr 21, 2021

My first try with icecream (Python 3.8)

ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in an interpreter (e.g. python -i), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
@alexmojaki
Copy link
Collaborator

Probably a duplicate of #68

Really need to fix that README and error message.

If you didn't try it in the shell, what did you do? The error message is completely generic.

@rnoxy
Copy link
Author

rnoxy commented Apr 21, 2021

I just run Python code using Pytorch and asked for
ic(some_torch_tensor)
and expected some more info about error. This message says nothing.

@alexmojaki
Copy link
Collaborator

Still need more detail than that. Can you provide a script and instructions to reproduce?

@rnoxy
Copy link
Author

rnoxy commented Apr 21, 2021

I am terribly sorry, I really cant reproduce it now.
It was my first try with ic so I assumed that this is regular behaviour.

Now, after few more tries, I see this package is stable. I cant reproduce the problem.

@rnoxy rnoxy closed this as completed Apr 21, 2021
@gruns
Copy link
Owner

gruns commented Apr 21, 2021

@rnoxy did the underlying source code change while the code was running? your editor could have saved a change even though you didn't

agreed @alexmojaki: changing the error message s/interpreter/REPL to be clearer now

@chkeo
Copy link

chkeo commented Apr 25, 2022

Version: 1.65.2 (system setup)
Commit: c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1
Date: 2022-03-10T14:33:55.248Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043

from icecream import ic

def foo(i):
return i + 333

ic(foo(123))

ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
456

Would love to use this module but it keeps getting this error.

@alexmojaki
Copy link
Collaborator

Version: 1.65.2 (system setup)

It took me a while to figure out that this was a VS Code version.

What version of Python are you using? How did you run the script?

@smprather
Copy link

I'm getting this error with Python 3.11.0b3. The same script I'm running works fine with Python 3.9. Have you tried 3.11 yet? It seems like something might have changed in the introspection.

@alexmojaki
Copy link
Collaborator

Yes, the underlying introspection doesn't work yet in 3.11, but it's getting close: alexmojaki/executing#31

@smprather
Copy link

Ok. Thanks @alexmojaki

@gruns
Copy link
Owner

gruns commented Aug 31, 2022

@alexmojaki: awesome @ alexmojaki/executing#31! 🙌

any estimate of when py3.11 support will land in executing? if not for a week+, ill add a note to icecream's readme that py3.11 isnt supported just yet 🙂

@alexmojaki
Copy link
Collaborator

I would say not for a week+

@gruns
Copy link
Owner

gruns commented Sep 1, 2022

sweet. i just added a quick note to the readme that py3.11 support is forthcoming

ill remove that note once alexmojaki/executing#31 lands 🙌

@rafaelcesar0
Copy link

My first attempt with icecream gave this error.
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?

Some information that may be useful:

  • Tested with python3.11.5 and 3.10 of MiniConda
  • I tried to run using PowerShell and Prompt
  • I also tried installing via pip and account
    pip install icecream
    conda install -c forklift icecream
    and also
    conda install -c conda-forge icecream

@vindevoy
Copy link

vindevoy commented Oct 9, 2023

Could it be that 3.11 is still not working ?

@alexmojaki
Copy link
Collaborator

3.11 should be working now. @rafaelcesar0 were you using a Python shell/REPL or did you run a .py file?

@vindevoy
Copy link

vindevoy commented Oct 9, 2023

I cannot confirm this at all. It works under 3.10 running from PyCharm, but not with 3.11. I see a similar error was logged just 16 hours ago by @rafaelcesar0

@alexmojaki
Copy link
Collaborator

  1. Do you have the latest version of executing installed on 3.11?
  2. Do you have IPython installed on 3.10?

@rafaelcesar0
Copy link

rafaelcesar0 commented Oct 9, 2023

I believe the Python shell/REPL. I was using powershell7 in vscode with the "Run Python file" command from the Python extension @alexmojaki

@rdhuff
Copy link

rdhuff commented Oct 10, 2023

I'm having the same error running a program under Python 3.11.4 in a venv under VSCode with icecream-2.1.3. Works great with Python 3.9.6 in a different venv.

@LI3ARA
Copy link

LI3ARA commented Oct 27, 2023

I started it using with python 3.12.0 Conda. It wasn't giving me the error with other versions.-in VS code

@GeeV1
Copy link

GeeV1 commented Nov 12, 2023

trying to print np.array and torch.tensor results in error message:
"ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?"

script to reproduce:

import torch
import numpy as np
import icecream
from icecream import ic
import sys


def main():
    print()
    print("Python version: ", sys.version)
    print("torch version: ", torch.__version__)
    print("numpy version: ", np.__version__)
    print("icecream version: ", icecream.__version__)
    print()

    arrnp = np.random.random([5,1])
    print("print statement (numpy): ", arrnp)
    ic(arrnp)
    tnsr = torch.tensor(arrnp)
    print("\nprint statement: ", tnsr)
    ic(tnsr)

if __name__ == '__main__':
    main()

output from script on my machine:

Python version:  3.11.6 | packaged by conda-forge | (main, Oct  3 2023, 10:37:07) [Clang 15.0.7 ]
torch version:  2.2.0.dev20231110
numpy version:  1.26.0
icecream version:  2.1.3

print statement (numpy):  [[0.12417735]
 [0.79481321]
 [0.63509578]
 [0.5155158 ]
 [0.05820374]]

print statement:  tensor([[0.1242],
        [0.7948],
        [0.6351],
        [0.5155],
        [0.0582]], dtype=torch.float64)
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?

@alexmojaki
Copy link
Collaborator

numpy and pytorch shouldn't be relevant. The version of executing is relevant. Everyone having problems, please run this script and share the output:

import inspect
import sys
import platform

import executing

print(sys.version)
print(executing.__version__)
print(platform.platform())

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
print(ex.statements)
print(ex.node)

@fepegar
Copy link

fepegar commented Nov 14, 2023

numpy and pytorch shouldn't be relevant. The version of executing is relevant. Everyone having problems, please run this script and share the output:

import inspect
import sys
import platform

import executing

print(sys.version)
print(executing.__version__)
print(platform.platform())

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
print(ex.statements)
print(ex.node)

Hello! Just landed in this page after getting the OP's error. Here's the output:

In [1]: import inspect
   ...: import sys
   ...: import platform
   ...:
   ...: import executing
   ...:
   ...: print(sys.version)
   ...: print(executing.__version__)
   ...: print(platform.platform())
   ...:
   ...: ex = executing.Source.executing(inspect.currentframe())
   ...: print(ex.source.lines)
   ...: print(ex.statements)
   ...: print(ex.node)
3.11.5 (main, Sep 11 2023, 08:31:25) [Clang 14.0.6 ]
0.8.3
macOS-14.0-arm64-arm-64bit
['import inspect', 'import sys', 'import platform', '', 'import executing', '', 'print(sys.version)', 'print(executing.__version__)', 'print(platform.platform())', '', 'ex = executing.Source.executing(inspect.currentframe())', 'print(ex.source.lines)', 'print(ex.statements)', 'print(ex.node)']
{<ast.Assign object at 0x105dc5720>}
None

@alexmojaki
Copy link
Collaborator

You can see what the latest version of executing is here: https://pypi.org/project/executing/

@fepegar
Copy link

fepegar commented Nov 15, 2023

You can see what the latest version of executing is here: https://pypi.org/project/executing/

I'm not sure whether this is a reply to me. I see that the last version is 2.0.1. I just created a Conda environment with python and ipython, which caused executing 0.8.3 to be installed. Then I pip-installed icecream, which didn't upgrade executing because

'executing>=0.3.1',

Would it be a good idea to use a more recent lower bound for the version of executing?

@erikpa1
Copy link

erikpa1 commented Jan 12, 2024

I have same problem inside py2exe

@scpalbright
Copy link

Same issue on python 3.11.5, appears when running in the Spyder ipython console and when calling a script from the terminal.

numpy and pytorch shouldn't be relevant. The version of executing is relevant. Everyone having problems, please run this script and share the output:

import inspect
import sys
import platform

import executing

print(sys.version)
print(executing.__version__)
print(platform.platform())

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
print(ex.statements)
print(ex.node)

Output:

3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0]
0.8.3
Linux-6.2.0-39-generic-x86_64-with-glibc2.35
['import inspect', 'import sys', 'import platform', '', 'import executing', '', 'print(sys.version)', 'print(executing.__version__)', 'print(platform.platform())', '', 'ex = executing.Source.executing(inspect.currentframe())', 'print(ex.source.lines)', 'print(ex.statements)', 'print(ex.node)']
{<ast.Assign object at 0x7f62c40d1ba0>}
None

@alexmojaki
Copy link
Collaborator

It seems that conda or something packages an old version of executing for reasons I don't understand. executing is a dependency of IPython, but it has a conda package that's up to date. I don't use conda myself. If someone could report an issue in the appropriate place that would be really helpful.

@scpalbright
Copy link

What version of executing is required? setup.py specifies executing>=0.3.1, so it's not clear how the version of executing is a problem.

Where would you like this to be reported?

Thanks

@alexmojaki
Copy link
Collaborator

1.0.0 is needed to fix a problem that often affects IPython users, hence this problem is bigger than icecream. I don't know where to report the issue or how to construct a good report, I don't use conda.

1.1.0 is needed for Python 3.11, hence the reports here.

2.0.1 is needed for Python 3.12.

Increasing the minimum version of executing here would be good, but it needs to be per Python version because 2.0.1 doesn't support Python 2. A PR would be appreciated.

@scpalbright
Copy link

executing==1.1.0 solved the problem for me on Python 3.11.5 both running in the terminal and in iPython.

@luke-ingram-sgr
Copy link

I am on Python 3.12, icecream 2.13 and executing 2.0.1 and I'm getting this issue.

@alexmojaki
Copy link
Collaborator

Please run this script and share the output:

import inspect
import sys
import platform

import executing

print(sys.version)
print(executing.__version__)
print(platform.platform())

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
print(ex.statements)
print(ex.node)

@cpdivers
Copy link

##Code:

`from icecream import ic

def foo(i):
return i + 333

ic(foo(123))`

returns: ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?

Result of your 'debug' code above:

3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]
0.8.2
Windows-10-10.0.22631-SP0
['import inspect', 'import sys', 'import platform', '', 'import executing', '', 'print(sys.version)', 'print(executing.version)', 'print(platform.platform())', '', 'ex = executing.Source.executing(inspect.currentframe())', 'print(ex.source.lines)', 'print(ex.statements)', 'print(ex.node)']
{<ast.Assign object at 0x0000023CDF93B8B0>}
None

@cpdivers
Copy link

executing==1.1.0 solved the problem for me on Python 3.11.5 both running in the terminal and in iPython.

Fixed the issue for me too, but I'm not sure about the ripple effect !

@Mit4Code
Copy link

I was getting the same error reported by others. In my Anaconda I had executing 0.8.3 and I didn't managed to update it in any way.

I ended up using conda uninstall executing. pip install executing got me the version 2.0.1 and icecream works without any issue.

@jendives2000
Copy link

I installed icecream using:
conda install conda-forge::icecream
and then conda install conda-forge::executing

This ensures I get both latest versions of ic and executing. It worked for me with python 3.12.

@Beth1708
Copy link

numpy and pytorch shouldn't be relevant. The version of executing is relevant. Everyone having problems, please run this script and share the output:

import inspect
import sys
import platform

import executing

print(sys.version)
print(executing.__version__)
print(platform.platform())

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
print(ex.statements)
print(ex.node)

I get this output:
3.11.8 (main, Feb 26 2024, 15:36:12) [Clang 14.0.6 ]
0.8.3
macOS-14.3.1-arm64-arm-64bit
['import inspect', 'import sys', 'import platform', '', 'import executing', '', 'print(sys.version)', 'print(executing.version)', 'print(platform.platform())', '', 'ex = executing.Source.executing(inspect.currentframe())', 'print(ex.source.lines)', 'print(ex.statements)', 'print(ex.node)']
{<ast.Assign object at 0x1062fec50>}
None

I'm running in a juypter notebook using dataspell
Thanks ...

@evnb
Copy link

evnb commented Mar 25, 2024

I’m also experiencing this sometimes in the Juno iOS app

@MadameMinty
Copy link

The issue is still very much live.

On Linux-aarch64-glibc2.31 REPL:

  • Python 3.9.19, executing==2.0.1: error

On Windows-10-10.0.19045-SP0 REPL:

  • Python 3.11.9, executing==1.1.0, 1.2.0, 2.0.1: error
  • Python 3.12.3, executing==1.1.0, 1.2.0, 2.0.1: error
  • Python 3.13.0b1, executing==2.0.1: no error

Failing combinations report:

>>> print(ex.source.lines)
[]
>>> print(ex.statements)
set()
>>> print(ex.node)
None

On working Python 3.13:

>>> print(ex.source.lines)
['ex = executing.Source.executing(inspect.currentframe())']
>>> print(ex.statements)
{<ast.Assign object at 0x0000022BC08B6250>}
>>> print(ex.node)
None

Reproduction code:

>>> from icecream import ic
>>> d = {'abc': 111, 'ghi': 333, 'def': 222}
>>> print(d)
{'abc': 111, 'ghi': 333, 'def': 222}
>>> ic(d)
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
{'abc': 111, 'ghi': 333, 'def': 222}

@alexmojaki
Copy link
Collaborator

>>> indicates you're in a REPL.

@MadameMinty
Copy link

MadameMinty commented May 13, 2024

Yes, I went all debug log instead of saying what my issue is: why is there an error in REPL at all? It could be just pretty-printed as fallback, surely? And again it's fine in 3.13, so that adds to my confusion.

@alexmojaki
Copy link
Collaborator

why is there an error in REPL at all?

The error is Failed to access the underlying source code for analysis which prevented it from telling you that the thing you printed was d. It tells you so that you know why that info was missing and so that you know that trying it in a REPL won't work. If all you want is to pretty-print in a REPL you can use from pprint import pp.

It could be just pretty-printed as fallback, surely?

This is a fair point which could be a new issue.

And again it's fine in 3.13, so that adds to my confusion.

The fact that source code is now available in the REPL in 3.13 is very exciting news.

@gmdelc66
Copy link

gmdelc66 commented Sep 6, 2024

I tried all the possible solutions that you published and in my case none of them worked, these are the errors and my equipment configuration, i have the same isuue in terminal and in Pycharm

ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?

This the result of the script
python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import inspect
import sys
import platform

import executing

print(sys.version)
3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0]
print(executing.version)
2.1.0
print(platform.platform())
Linux-6.8.0-40-generic-x86_64-with-glibc2.35

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
[]
print(ex.statements)
set()
print(ex.node)
None

(base) gatito@gatito-All-Series:~$ conda env list

conda environments:

base * /home/gatito/anaconda3

(base) gatito@gatito-All-Series:$ pip install icecream
Collecting icecream
Downloading icecream-2.1.3-py2.py3-none-any.whl.metadata (1.4 kB)
Requirement already satisfied: colorama>=0.3.9 in ./anaconda3/lib/python3.12/site-packages (from icecream) (0.4.6)
Requirement already satisfied: pygments>=2.2.0 in ./anaconda3/lib/python3.12/site-packages (from icecream) (2.15.1)
Requirement already satisfied: executing>=0.3.1 in ./anaconda3/lib/python3.12/site-packages (from icecream) (0.8.3)
Requirement already satisfied: asttokens>=2.0.1 in ./anaconda3/lib/python3.12/site-packages (from icecream) (2.0.5)
Requirement already satisfied: six in ./anaconda3/lib/python3.12/site-packages (from asttokens>=2.0.1->icecream) (1.16.0)
Downloading icecream-2.1.3-py2.py3-none-any.whl (8.4 kB)
Installing collected packages: icecream
Successfully installed icecream-2.1
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from icecream import ic

def test():
... x = 10
... ic(x)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ pip install executing==2.0.0
Collecting executing==2.0.0
Downloading executing-2.0.0-py2.py3-none-any.whl.metadata (9.0 kB)
WARNING: The candidate selected for download or install is a yanked version: 'executing' candidate (version 2.0.0 at https://files.pythonhosted.org/packages/bb/3f/748594706233e45fd0e6fb57a2fbfe572485009c52b19919d161a0ae5d52/executing-2.0.0-py2.py3-none-any.whl (from https://pypi.org/simple/executing/))
Reason for being yanked: Released 2.0.1 which is equivalent but added 'python_requires = >=3.5' so that pip install with Python 2 uses the previous version 1.2.0.
Downloading executing-2.0.0-py2.py3-none-any.whl (24 kB)
Installing collected packages: executing
Attempting uninstall: executing
Found existing installation: executing 0.8.3
Uninstalling executing-0.8.3:
Successfully uninstalled executing-0.8.3
Successfully installed executing-2.0.0
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ pip install -U executing
Requirement already satisfied: executing in ./anaconda3/lib/python3.12/site-packages (2.0.0)
Collecting executing
Downloading executing-2.1.0-py2.py3-none-any.whl.metadata (8.9 kB)
Downloading executing-2.1.0-py2.py3-none-any.whl (25 kB)
Installing collected packages: executing
Attempting uninstall: executing
Found existing installation: executing 2.0.0
Uninstalling executing-2.0.0:
Successfully uninstalled executing-2.0.0
Successfully installed executing-2.1.0
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ pip uninstall icecream
Found existing installation: icecream 2.1.3
Uninstalling icecream-2.1.3:
Would remove:
/home/gatito/anaconda3/lib/python3.12/site-packages/icecream-2.1.3.dist-info/*
/home/gatito/anaconda3/lib/python3.12/site-packages/icecream/*
Proceed (Y/n)? y
Successfully uninstalled icecream-2.1.3
(base) gatito@gatito-All-Series:
$ conda install conda-forge::icecream
Retrieving notices: ...working... done
Channels:

  • defaults
  • conda-forge
    Platform: linux-64
    Collecting package metadata (repodata.json): done
    Solving environment: done

Package Plan

environment location: /home/gatito/anaconda3

added / updated specs:
- conda-forge::icecream

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
certifi-2024.8.30          |  py312h06a4308_0         163 KB
icecream-2.1.3             |     pyhd8ed1ab_0          12 KB  conda-forge
openssl-3.0.15             |       h5eee18b_0         5.2 MB
------------------------------------------------------------
                                       Total:         5.4 MB

The following NEW packages will be INSTALLED:

executing pkgs/main/noarch::executing-0.8.3-pyhd3eb1b0_0
icecream conda-forge/noarch::icecream-2.1.3-pyhd8ed1ab_0

The following packages will be UPDATED:

certifi 2024.7.4-py312h06a4308_0 --> 2024.8.30-py312h06a4308_0
openssl 3.0.14-h5eee18b_0 --> 3.0.15-h5eee18b_0

Proceed ([y]/n)? y

Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) gatito@gatito-All-Series:~$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ pip install executing==2.0.0
Collecting executing==2.0.0
Using cached executing-2.0.0-py2.py3-none-any.whl.metadata (9.0 kB)
WARNING: The candidate selected for download or install is a yanked version: 'executing' candidate (version 2.0.0 at https://files.pythonhosted.org/packages/bb/3f/748594706233e45fd0e6fb57a2fbfe572485009c52b19919d161a0ae5d52/executing-2.0.0-py2.py3-none-any.whl (from https://pypi.org/simple/executing/))
Reason for being yanked: Released 2.0.1 which is equivalent but added 'python_requires = >=3.5' so that pip install with Python 2 uses the previous version 1.2.0.
Using cached executing-2.0.0-py2.py3-none-any.whl (24 kB)
Installing collected packages: executing
Attempting uninstall: executing
Found existing installation: executing 0.8.3
Uninstalling executing-0.8.3:
Successfully uninstalled executing-0.8.3
Successfully installed executing-2.0.0
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ pip install -U executing
Requirement already satisfied: executing in ./anaconda3/lib/python3.12/site-packages (2.0.0)
Collecting executing
Using cached executing-2.1.0-py2.py3-none-any.whl.metadata (8.9 kB)
Using cached executing-2.1.0-py2.py3-none-any.whl (25 kB)
Installing collected packages: executing
Attempting uninstall: executing
Found existing installation: executing 2.0.0
Uninstalling executing-2.0.0:
Successfully uninstalled executing-2.0.0
Successfully installed executing-2.1.0
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ executing==1.1.0
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ pip install executing==1.1.0
Collecting executing==1.1.0
Downloading executing-1.1.0-py2.py3-none-any.whl.metadata (8.9 kB)
Downloading executing-1.1.0-py2.py3-none-any.whl (22 kB)
Installing collected packages: executing
Attempting uninstall: executing
Found existing installation: executing 2.1.0
Uninstalling executing-2.1.0:
Successfully uninstalled executing-2.1.0
Successfully installed executing-1.1.0
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
quit()
(base) gatito@gatito-All-Series:$ pip install -U executing
Requirement already satisfied: executing in ./anaconda3/lib/python3.12/site-packages (1.1.0)
Collecting executing
Using cached executing-2.1.0-py2.py3-none-any.whl.metadata (8.9 kB)
Using cached executing-2.1.0-py2.py3-none-any.whl (25 kB)
Installing collected packages: executing
Attempting uninstall: executing
Found existing installation: executing 1.1.0
Uninstalling executing-1.1.0:
Successfully uninstalled executing-1.1.0
Successfully installed executing-2.1.0
(base) gatito@gatito-All-Series:
$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
import inspect
import sys
import platform

import executing

print(sys.version)
3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0]
print(executing.version)
2.1.0
print(platform.platform())
Linux-6.8.0-40-generic-x86_64-with-glibc2.35

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
[]
print(ex.statements)
set()
print(ex.node)
None
from icecream import ic

KeyboardInterrupt

ic("test")
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
(base) gatito@gatito-All-Series:~$ conda install conda-forge::icecream
Channels:

  • defaults
  • conda-forge
    Platform: linux-64
    Collecting package metadata (repodata.json): done
    Solving environment: done

Package Plan

environment location: /home/gatito/anaconda3

added / updated specs:
- conda-forge::icecream

The following NEW packages will be INSTALLED:

executing pkgs/main/noarch::executing-0.8.3-pyhd3eb1b0_0

Proceed ([y]/n)? y

Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) gatito@gatito-All-Series:~$ conda install conda-forge::executing
Channels:

  • defaults
  • conda-forge
    Platform: linux-64
    Collecting package metadata (repodata.json): done
    Solving environment: done

Package Plan

environment location: /home/gatito/anaconda3

added / updated specs:
- conda-forge::executing

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
executing-2.1.0            |     pyhd8ed1ab_0          28 KB  conda-forge
------------------------------------------------------------
                                       Total:          28 KB

The following packages will be UPDATED:

executing pkgs/main::executing-0.8.3-pyhd3eb1b0~ --> conda-forge::executing-2.1.0-pyhd8ed1ab_0

Proceed ([y]/n)? y

Downloading and Extracting Packages:

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(base) gatito@gatito-All-Series:~$ python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?
from pprint import pp
from icecream import ic

def test():
... x = 10
... y = 20
... ic(x, y)
...
test()
ic| Error: Failed to access the underlying source code for analysis. Was ic() invoked in a REPL (e.g. from the command line), a frozen application (e.g. packaged with PyInstaller), or did the underlying source code change during execution?

this the result of the script
python
Python 3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import inspect
import sys
import platform

import executing

print(sys.version)
3.12.4 | packaged by Anaconda, Inc. | (main, Jun 18 2024, 15:12:24) [GCC 11.2.0]
print(executing.version)
2.1.0
print(platform.platform())
Linux-6.8.0-40-generic-x86_64-with-glibc2.35

ex = executing.Source.executing(inspect.currentframe())
print(ex.source.lines)
[]
print(ex.statements)
set()
print(ex.node)
None

@gmdelc66
Copy link

gmdelc66 commented Sep 6, 2024

Problem solved, I had already given up on using icecream, initially I detected the problem when trying to use ic in pycharm, then all the tests I did, I did them from a terminal outside of pycharm, I posted my previous comment, and when I return to pycharm and run my program with ic (to find & change the lines with ic ), the program worked without any problem, at some point with the solutions I tried, corrected the problem, I write this so someone else can find the real solution.

ic| f": ("Models in whisper: ['tiny.en', 'tiny', 'base.en', 'base', "
"'small.en', 'small', 'medium.en', 'medium', 'large-v1', 'large-v2', "
"'large-v3', 'large']")

@alexmojaki
Copy link
Collaborator

That was in a REPL, i.e. the interactive shell.

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