Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running "python setup.py develop" when setting up environment #2107

Closed
EdIzaguirre opened this issue Oct 19, 2023 · 3 comments · Fixed by #2118
Closed

Issue running "python setup.py develop" when setting up environment #2107

EdIzaguirre opened this issue Oct 19, 2023 · 3 comments · Fixed by #2118
Labels
type:Bug Something isn't working

Comments

@EdIzaguirre
Copy link
Contributor

EdIzaguirre commented Oct 19, 2023

Current Behavior:

When attempting to follow the directions in the contribution guide, I am getting an error when running the following line:
python setup.py develop

No `name` configuration, performing automatic discovery
running develop
/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/command/develop.py:40: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  easy_install.initialize_options(self)
/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
running egg_info
writing keras_cv.egg-info/PKG-INFO
writing dependency_links to keras_cv.egg-info/dependency_links.txt
writing requirements to keras_cv.egg-info/requires.txt
writing top-level names to keras_cv.egg-info/top_level.txt
reading manifest file 'keras_cv.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '*.so' under directory 'keras_cv/custom_ops'
adding license file 'LICENSE'
writing manifest file 'keras_cv.egg-info/SOURCES.txt'
running build_ext
Creating /Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/keras-cv.egg-link (link to .)
Adding keras-cv 0.6.4 to easy-install.pth file

Installed /Users/ed/keras-cv/keras-cv/keras-cv/keras-cv
Processing dependencies for keras-cv==0.6.4
Traceback (most recent call last):
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2827, in requires
    deps.extend(dm[safe_extra(ext)])
                ~~^^^^^^^^^^^^^^^^^
KeyError: 'array_types'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/ed/keras-cv/keras-cv/keras-cv/keras-cv/setup.py", line 43, in <module>
    setup(
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/dist.py", line 1234, in run_command
    super().run_command(command)
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/command/develop.py", line 34, in run
    self.install_for_development()
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/command/develop.py", line 126, in install_for_development
    self.process_distribution(None, self.dist, not self.no_deps)
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/setuptools/command/easy_install.py", line 750, in process_distribution
    distros = WorkingSet([]).resolve(
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 834, in resolve
    new_requirements = dist.requires(req.extras)[::-1]
                       ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ed/miniconda3/envs/keras-cv/lib/python3.11/site-packages/pkg_resources/__init__.py", line 2829, in requires
    raise UnknownExtra(
pkg_resources.UnknownExtra: etils 1.5.1 has no such extra feature 'array_types'

Expected Behavior:

I expected to be able to run the python file successfully.

Steps To Reproduce:

Create a new conda environment (I am on MacOS), and just run the four lines suggested in the contributor guide:

gh repo fork keras-team/keras-cv --clone --remote
cd keras-cv
pip install ".[tests]"
python setup.py develop

Version:

Keras 0.6.4
Python 3.11.5
MacOS Sonoma 14.0

Anything else:

I tried this in my working conda environment with Python, TensorFlow, and tf-metal for M1 Macs. When it didn't work, I then created a clean conda environment, and ran the four lines mentioned in the contributor guide. The issue persisted. All other lines were successful.

@EdIzaguirre EdIzaguirre added the type:Bug Something isn't working label Oct 19, 2023
@EdIzaguirre
Copy link
Contributor Author

EdIzaguirre commented Oct 19, 2023

After navigating to both links mentioned in the warnings, it appears that using python setup.py develop is deprecated, and should no longer be used. Instead, to install the setup files we should be using:

pip install -e .

Check out this link for more details. Scroll to the bottom for a table with the new commands. After running this command instead, it appears to work. Running pytest keras_cv now runs the tests and finishes with:

========================== 1379 passed, 517 skipped in 224.99s (0:03:44) ==========================

Does this indicate it has worked? If so, I can add a pull request to change the documentation to the appropriate command.

@ianstenbit
Copy link
Contributor

If python setup.py develop is in fact deprecated, then yes please to update the documentation. This does seem to indicate that the environment is set up correctly.

@EdIzaguirre
Copy link
Contributor Author

I'll get this done ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants