I am currently working with tensorflow on a new mac with M1 chip.
As you might know, getting tensorflow to work on the M1 chip is a bit messy but I managed to do it following this tutorial: https://github.com/mrdbourke/m1-machine-learning-test
Now, I have an environment named tensorflow-test with python 3.8 and tensorflow correctly installed (I can import it without errors).
Within this environment, I want to build some command lines using click package. I used to have everything integrated beautifully until, for some weird reason, I messed up with the environment and now I can't figure out what is going on.
A simple code to reproduce what I have is the following. Within the tensorflow-test conda environment I have a file with click code hello.py:
import click
import tensorflow
@click.command()
@click.option('--count', default=1, help='Number of greetings.')
@click.option('--name', prompt='Your name',
help='The person to greet.')
def cli(count, name):
"""Simple program that greets NAME for a total of COUNT times."""
for x in range(count):
click.echo("Hello {name}!")
if __name__ == '__main__':
cli()
and another with the set up, setup.py :
from setuptools import setup
setup(
name="hello",
version='0.1',
py_modules=['hello'],
author='xxx',
install_requires=[
'Click',
'pandas',
'tensorflow',
],
entry_points='''
[console_scripts]
hello=hello:cli
''',
)
When I run it using python hello.py everything seems to be working fine. However, when I try to integrate this to be run directly as a command line, I do
pip install --editable .
and the following error appears:
Requirement already satisfied: Click in ./env/lib/python3.8/site-packages (from hello==0.1) (8.0.4)
Requirement already satisfied: pandas in ./env/lib/python3.8/site-packages (from hello==0.1) (1.4.2)
ERROR: Could not find a version that satisfies the requirement tensorflow (from hello) (from versions: none)
ERROR: No matching distribution found for tensorflow
I checked and there is a folder named tensorflow in ./env/lib/python3.8/site-packages.
What is going on? Why can't I use hello directly as a command when everything seems to be working fine otherwise?