Run with console issue

I have code that processes pandas dataframes and changes variables overtime. I need to debug it often. I chose PyCharm to stop and look inside the dataframe (scientific mode). It seems that only the console will enable this (ability to view dataframes). What I'm trying to do is run my .py file in the console, I have set up a “Run with Console” Run/Debug Configuration. In the “Modify Options” I have selected Run with Console. I have put the venv where it needs to be I run a script with value $FilePath$ (the preview of this shows the right path to the file). The working directory is the right one. When I run it I get:

runfile('/Run with Console.py', wdir='...myworkingdir...')
Traceback (most recent call last):
  File "...myworkingdir.../venv/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 3577, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-4c34cb479eaf>", line 1, in <module>
    runfile('/Run with Console.py', wdir='...myworkingdir...')
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 197, in runfile
    pydev_imports.execfile(filename, global_vars, local_vars)  # execute the script
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 11, in execfile
    stream = tokenize.open(file)  # @UndefinedVariable
             ^^^^^^^^^^^^^^^^^^^
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/tokenize.py", line 396, in open
    buffer = _builtin_open(filename, 'rb')
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Run with Console.py'

 

I of course replaced my working dir with the string ...myworkingdir…  where it is my working directory… My file is called out.py…

How to I run my out.py file in the console when it insists on '/Run with Console.py' ?

 

0
> It seems that only the console will enable this (ability to view dataframes).

And also the debugger. You can investigate the dataframe in the console at any breakpoint. Also, it's probably not a good idea to include spaces in your .py file names.
0

My file is named out.py. It's the system that somehow put “Run with Console.py”… I have no idea where this came from that's the name of my config. 

And yes, I'm aware that only the console will enable this, this is why i'm trying to run the file in the console.

 

Thanks

0
Hmm, I see. Could you please show a screenshot of your run/debug configuration?
0

thanks for sharing…

0

请先登录再写评论。