Skip to content

Add how to install and use section to README #264

@rowoflo

Description

@rowoflo

I am getting the common mypy error for my project.

error: Skipping analyzing "scipy.spatial.transform": module is installed, but missing library stubs or py.typed marker  [import]
note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 3 source files)

I see that the scipy.spatial.transform library stubs are provided with this project. But I don't know how to install them.

I tried installing with pip in my 3.8.13 virtual environment

pip install git+https://github.com/microsoft/python-type-stubs.git 

but I get this error

Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113
Collecting git+https://github.com/microsoft/python-type-stubs.git
  Cloning https://github.com/microsoft/python-type-stubs.git to /tmp/pip-req-build-8p0xrczh
  Running command git clone --filter=blob:none --quiet https://github.com/microsoft/python-type-stubs.git /tmp/pip-req-build-8p0xrczh
  Resolved https://github.com/microsoft/python-type-stubs.git to commit f3c68e1cf40ef6687e6d961489ced0da6516c77a
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [14 lines of output]
      error: Multiple top-level packages discovered in a flat-layout: ['cv2', 'vispy', 'pygame', 'sklearn', 'skimage', 'lightgbm', 'networkx', 'pendulum', 'tenacity', 'openpyxl', 'matplotlib', 'sqlalchemy'].

      To avoid accidental inclusion of unwanted files or directories,
      setuptools will not proceed with this build.

      If you are trying to create a single distribution with multiple packages
      on purpose, you should not rely on automatic discovery.
      Instead, consider the following options:

      1. set up custom discovery (`find` directive with `include` or `exclude`)
      2. use a `src-layout`
      3. explicitly set `py_modules` or `packages` with a list of names

      To find more information, look for "package discovery" on setuptools docs.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

What is the recommended way to install python-type-stubs and are there any pointers for using it?

It would be great if this information could be added to the README.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions