Qiskit / qiskit-tutorials

A collection of Jupyter notebooks showing how to use the Qiskit SDK
Apache License 2.0
2.33k stars 1.29k forks source link

Add requirements-dev.txt #1323

Closed bopardikarsoham closed 2 years ago

bopardikarsoham commented 2 years ago

I have added a requirements-dev.txt file as per Issue https://github.com/Qiskit/qiskit-tutorials/issues/1317. This contains all the packages used in the qiskit-tutorials repo. I also double-checked all of the packages required for this repository.

Closes #1317

HuangJunye commented 2 years ago

Thanks! Can you try to do a local build with sphinx with a fresh environment to check that this file contains all and only necessary packages?

bopardikarsoham commented 2 years ago

Sure, I'll test it out locally

bopardikarsoham commented 2 years ago

@HuangJunye I have tested it locally by creating a new virtual environment in my PC and installing all the packages from scratch in the requirements-dev.txt file through the pip install -r requirements-dev.txt command. The packages were successfully installed and everything seems to be working well including sphinx thumbnails.

HuangJunye commented 2 years ago

@bopardikarsoham That's awesome! I am having some troubles making a local build on my machine. https://github.com/Qiskit/qiskit-tutorials/issues/1324

I think a lot of these requirements are already in qiskit and qiskit[visualization]. Can you try this simplified version?

qiskit
jupyter
sphinx
nbsphinx
sphinx_rtd_theme
networkx
scikit-learn
matplotlib
qiskit[visualization]
cvxpy
pyscf
graphviz

I had a look at the CI and I think these should be sufficient based on https://github.com/Qiskit/qiskit-tutorials/blob/c98b29af9ca4350a940f5e48b911ffb4f1be5557/azure-pipelines.yml#L39-L43 The only missing requirement would be pandoc but it's not pip installable because it's not a python package.

bopardikarsoham commented 2 years ago

Yes @HuangJunye , I believe this list is sufficient and capable of installing all of the packages required for this repo to function. I figured that out too in the pipelines file.

bopardikarsoham commented 2 years ago

@bopardikarsoham That's awesome! I am having some troubles making a local build on my machine. #1324

I think a lot of these requirements are already in qiskit and qiskit[visualization]. Can you try this simplified version?

qiskit
jupyter
sphinx
nbsphinx
sphinx_rtd_theme
networkx
scikit-learn
matplotlib
qiskit[visualization]
cvxpy
pyscf
graphviz

I had a look at the CI and I think these should be sufficient based on

https://github.com/Qiskit/qiskit-tutorials/blob/c98b29af9ca4350a940f5e48b911ffb4f1be5557/azure-pipelines.yml#L39-L43

The only missing requirement would be pandoc but it's not pip installable because it's not a python package.

Replacing graphviz with pydot will fix everything

mtreinish commented 2 years ago

graphviz isn't a python dependency and can not be listed in a requirements list as pip will not be able to install it for you. It is something you have to install separately through a different mechanism (see: https://graphviz.org/download/ )

HuangJunye commented 2 years ago

@mtreinish Is there a reason why the python dependencies are installed in this order? Especially for qiskit[visualization], does it have to be after matplotlib?

https://github.com/Qiskit/qiskit-tutorials/blob/c98b29af9ca4350a940f5e48b911ffb4f1be5557/azure-pipelines.yml#L39-L43

And matplotlib is set to be lower than 3.3 (probably due to a incompatibility reason in the past) while Qiskit dependency is higher than 3.3. I installed the latest 3.5.2 without issues.