sid5432 / pyOTDR

Simple OTDR SOR file parser written in Python
GNU General Public License v3.0
71 stars 28 forks source link

FileNotFoundError - requirements.txt #39

Closed aleko205 closed 2 years ago

aleko205 commented 2 years ago

I'm trying to install pyotdr with pip install pyotdr But there is a some error

Collecting pyotdr
  Downloading https://files.pythonhosted.org/packages/1c/4a/9d96cd9fce1f9b9fff035c783481384e5762de504815bbdc1781caad47d4/pyotdr-2.1.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-jrm41ola/pyotdr/setup.py", line 21, in <module>
        with open(path.join(here, "requirements.txt")) as f:
      File "/usr/lib64/python3.6/codecs.py", line 897, in open
        file = builtins.open(filename, mode, buffering)
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-jrm41ola/pyotdr/requirements.txt'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-jrm41ola/pyotdr/

Do you have a suggestion what is the problem?

thank you in advance

sid5432 commented 2 years ago

I am seeing similar error messages also (with Python 3.8. 3.9, and 3.10), but I cannot see why this is happening. The requirements.txt file is included in the distribution! At this time, all I can suggest is to get the files directly. You have two options: the first is to download the tar file from GitHub, the other is to use git to clone the repository from GitHub.

Once you have the files, change directory to the top level directory, and run

pip install .

(note the "." after "install") Or you can run

python setup.py install

Either of these should work and install the package.

aleko205 commented 2 years ago

Thank you! Now it's works.

RemiDesgrange commented 2 years ago

Thanks for the report. I think this is because only .py files are shipped in a package to pypi. requirement.txt should not be required when installing. I'll debug that.

RemiDesgrange commented 2 years ago

Ok @aleko205 could you tests on a newly created venv ?

aleko205 commented 2 years ago

@RemiDesgrange I tested it on another centos and installed successfully and works fine! But only one thing, as I see in the previous commit note "Fix case problem in windows (and linux) making everything lowercase" but I can't run it with pyotdr, I have to enter pyOTDR

[root@localhost ~]# 
[root@localhost ~]# pyotdr
-bash: pyotdr: command not found
[root@localhost ~]# 
[root@localhost ~]# pyOTDR
usage: pyOTDR [-h] SOR_file [{JSON,XML}]
pyOTDR: error: the following arguments are required: SOR_file
[root@localhost ~]# 

Anyway it's not problem for me, Thank you

RemiDesgrange commented 2 years ago

Yes, I think I messed up something when changing the README.

import pyotdr
pyotdr.sorparse("my.sor")
aleko205 commented 2 years ago

@RemiDesgrange Thank you