12

I'm trying to follow the contribution guide for documentation. The required steps are:

git clone https://github.com/tensorflow/tensorflow tensorflow
cd tensorflow/tensorflow/tools/docs 
pip install tensorflow==2.0.0-alpha0 
python generate2.py --output_dir=/tmp/out

But the last command gives me:

Traceback (most recent call last): File "generate2.py", line 36, in from tensorflow_docs.api_generator import doc_controls ModuleNotFoundError: No module named 'tensorflow_docs'

This is in line 36 of generate2.py:

from tensorflow_docs.api_generator import doc_controls

I haven't found a pip package containing tensorflow_docs. Any ideas?

3 Answers 3

20

First install tensorflow_docs using this command:

pip install git+https://github.com/tensorflow/docs

1
  • I run code above but got "ERROR: Package 'tensorflow-docs' requires a different Python: 3.8.18 not in '>=3.9'" Commented Feb 15, 2024 at 8:41
3

first, you need to install git.

install git by using this command conda install git in anaconda prompt. then run the following command

!pip install -q git+https://github.com/tensorflow/docs 

in jupyter notebook

OR

pip install -q git+https://github.com/tensorflow/docs

in anaconda prompt.

0

I have a try and figure out how to solve the problem. Since I have multuple Python versions by checking "conda list" and "pip list", either the Jupyter or IDE installation method could not install tensorflow_docs into the correct directory.

1.For Jupyter

$ conda install git
$ !pip install -q git+https://github.com/tensorflow/docs

2.For IDE

$ conda install git
$ pip install -q git+https://github.com/tensorflow/docs

The problem is that pip has installed tensorflow_docs into the default directory of Python 3.6 with the following path: /home/user/local/lib/python3.6/site-packages. However, I use Python 3.9 in the conda environment in the most of the time.

3.Copy tensorflow_docs into Python 3.9 site-packages

It is applicable after putting tensorflow_docs to the designated directory of Python 3.9. So I can use tensorflow_docs after the following operations:

First.Download tensorflow_docs

https://github.com/tensorflow/docs/tree/master/tools/tensorflow_docs

Second.Save tensorflow_docs in Python 3.9 directory

/home/user/miniconda3/lib/python3.9/site-packages/tensorflow_docs

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.