Unable to find transmission_main_example.py
fehmidaUsmani opened this issue · 3 comments
I am unable to find transmission_main_example.py from the given data. I copied the examples folder from https://github.com/dutc/gnpy when I tried to run it. it gives me the following errors. I am using anaconda environment.
transmission_main_example.py does not exist anymore as a standalone script. The animated example in the README is wrong and should be updated. Now you can run it like this:
$ gnpy-transmission-example $(gnpy-example-data)/CORONET_Global_Topology.json
Have a look at the instructions below the (erroneous) animation in the README.
Edit: to clarify, the code of the old transmission_main_example.py is now a function in cli_examples.py, and this function is what gnpy-transmission-example
runs.
(base) C:\Users\HP\oopt-gnpy>gnpy-transmission-example
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init_.py", line 574, in build_master
ws.require(requires)
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 892, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init_.py", line 783, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (sphinxcontrib-bibtex 0.3.6 (c:\users\hp\appdata\local\continuum\anaconda3\lib\site-packages), Requirement.parse('sphinxcontrib-bibtex<1,>=0.4.2'), {'gnpy'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\Scripts\gnpy-transmission-example-script.py", line 6, in
from pkg_resources import load_entry_point
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init_.py", line 3086, in
@call_aside
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 3070, in call_aside
f(*args, **kwargs)
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 3099, in _initialize_master_working_set
working_set = WorkingSet.build_master()
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 576, in _build_master
return cls.build_from_requirements(requires)
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 589, in build_from_requirements
dists = ws.resolve(reqs, Environment())
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 778, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'sphinxcontrib-bibtex<1,>=0.4.2' distribution was not found and is required by gnpy
transmission_main_example.py does not exist anymore as a standalone script. The animated example in the README is wrong and should be updated. Now you can run it like this:
$ gnpy-transmission-example $(gnpy-example-data)/CORONET_Global_Topology.json
Have a look at the instructions below the (erroneous) animation in the README.
Edit: to clarify, the code of the old transmission_main_example.py is now a function in cli_examples.py, and this function is what
gnpy-transmission-example
runs.
Thank you so much for your guidance. when I tried to run $ gnpy-transmission-example i am getting following error.
(base) C:\Users\HP\oopt-gnpy>gnpy-transmission-example
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init_.py", line 574, in build_master
ws.require(requires)
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 892, in require
needed = self.resolve(parse_requirements(requirements))
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init_.py", line 783, in resolve
raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.ContextualVersionConflict: (sphinxcontrib-bibtex 0.3.6 (c:\users\hp\appdata\local\continuum\anaconda3\lib\site-packages), Requirement.parse('sphinxcontrib-bibtex<1,>=0.4.2'), {'gnpy'})
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\Scripts\gnpy-transmission-example-script.py", line 6, in
from pkg_resources import load_entry_point
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init_.py", line 3086, in
@call_aside
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 3070, in call_aside
f(*args, **kwargs)
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 3099, in _initialize_master_working_set
working_set = WorkingSet.build_master()
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 576, in _build_master
return cls.build_from_requirements(requires)
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 589, in build_from_requirements
dists = ws.resolve(reqs, Environment())
File "C:\Users\HP\AppData\Local\Continuum\anaconda3\lib\site-packages\pkg_resources_init.py", line 778, in resolve
raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'sphinxcontrib-bibtex<1,>=0.4.2' distribution was not found and is required by gnpy
Hi @fehmidaUsmani , the repo that you used (https://github.com/dutc/gnpy) is a copy of a two-years-old version of GNPy. If you're using data from there along with the newest code, it is likely that the result won't work.
My suggestion is to start from scratch following the instructions in our docs. In particular, be sure to start with a clean Python virtual environment, and be sure that you run the installation step pip install something...
). Please let us know if it helps.