Python pyfiles and cis.read_data() function error

As also very repeatedly said here,

Python 2.7 was released in 2010, which definety predates any release of CondaPkg, since it even predates the first release of Julia (2012).

So – as also written here several times by now: you need to update your Python code to at least run on Python 3.8. I have not seen much in CondaPkg, but Conda.jl writes

that you have to specifically set everything up quite differently if you want to run Python 2 code. I personally would not try to get archaeological code to run in a current setup but rewrite the Python 2.7 code in a modern Python 3.x.

1 Like

Yes, but i want to use julia and in python3.12.2 i am getting ModuleNotFoundError: No module named 'athena_read' but my pyfiles directory contains it. :yawning_face:

 οŒ’ ξ‚°  ~ ξ‚° cd ./Pictures/MikiForRaman                                      ξ‚² βœ” 
 οŒ’ ξ‚°  ~/Pictures/MikiForRaman ξ‚° python m2c_read_athdata.py                ξ‚² βœ” 
/home/raman/Pictures/MikiForRaman/m2c_read_athdata.py:1: SyntaxWarning: invalid escape sequence '\d'
  """
/home/raman/Pictures/MikiForRaman/m2c_read_athdata.py:146: SyntaxWarning: invalid escape sequence '\m'
  '''
Traceback (most recent call last):
  File "/home/raman/Pictures/MikiForRaman/m2c_read_athdata.py", line 37, in <module>
    from pyfiles import read_athinput 
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raman/Pictures/MikiForRaman/pyfiles/__init__.py", line 3, in <module>
    from .unimesh import *
  File "/home/raman/Pictures/MikiForRaman/pyfiles/unimesh.py", line 15, in <module>
    import athena_read
ModuleNotFoundError: No module named 'athena_read'
 οŒ’ ξ‚°  ~/Pi/MikiForRaman ξ‚° cd ./pyfiles                                  ξ‚² 1 ✘ 
 οŒ’ ξ‚°  ~/Pi/M/pyfiles ξ‚° ls                                                 ξ‚² βœ” 
athena_read.py   fm_torus.pyc  metric.py    read_athinput.py   read_data.pyc
athena_read.pyc  __init__.py   metric.pyc   read_athinput.pyc  unimesh.py
fm_torus.py      __init__.pyc  __pycache__  read_data.py       unimesh.pyc

Well, that is a Python error I personally can not help you with.

I also will stop answering here, since this whole thread slowly seems to be really just a repetition of a lot of errors you are facing and you seem to expect us to just solve all these.
I usually even do expect my first year students to try for quite a while themselves before they ask for help. And we also repeatedly said, that we can not fix your Python errors probably. At least I can’t. I do not program in Python.

4 Likes

That looks like your local package, you pip installed a different package of the same name from PyPI, which evidently does not have the same files as yours. This is the 3rd time now that you revealed a wholly Python issue, and it’s abundantly clear that you need to learn Python fundamentals (versioning, packaging, environments) and to communicate more clearly with Python users and developers, and it is not feasible to expect this in a Julia forum. If you haven’t resolved your several separate issues on the Python side, no amount of CondaPkg, PythonCall, or PyCall knowledge will get your code to work. Godspeed on that work, and after you are done, you are welcome to ask about any issues actually pertaining to PythonCall or PyCall.

3 Likes

Hi Everyone, I have converted my code to python3. It is now working fine in Python3.12.2. Please help me in reading that python code within Julia. Let me start a fresh discussion in new thread.
THE END :sauropod:

1 Like