wolph / numpy-stl

Simple library to make working with STL files (and 3D objects in general) fast and easy.
http://numpy-stl.readthedocs.org/
BSD 3-Clause "New" or "Revised" License
624 stars 105 forks source link

<frozen importlib._bootstrap>:219: FutureWarning: #131

Closed nilswagner closed 3 years ago

nilswagner commented 4 years ago

When I import stl in python3.8.2 I get

>>> import stl
<frozen importlib._bootstrap>:219: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
>>> stl.__about__.__version__
'2.11.2'

How can I resolve the problem?

wolph commented 4 years ago

It looks like the warning is about numpy, not numpy-stl. So I'm guessing your numpy needs to be upgraded.

For what it's worth, I can't replicate it:

# pip install numpy-stl
Collecting numpy-stl
  Downloading numpy-stl-2.11.2.tar.gz (484 kB)
     |¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦| 484 kB 3.0 MB/s
Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from numpy-stl) (1.17.4)
Collecting python-utils>=1.6.2
  Downloading python_utils-2.4.0-py2.py3-none-any.whl (12 kB)
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from python-utils>=1.6.2->numpy-stl) (1.14.0)
Building wheels for collected packages: numpy-stl
  Building wheel for numpy-stl (setup.py) ... done
  Created wheel for numpy-stl: filename=numpy_stl-2.11.2-py3-none-any.whl size=17629 sha256=c71346e37bba95bb76a7635b5c1d29677b28312c7219b00358937aeba4711b2d
  Stored in directory: .cache/pip/wheels/f1/d8/17/4aaa75d86d7c4c5c026c28b0f695ea185336fa0a6e4ec2190c
Successfully built numpy-stl
Installing collected packages: python-utils, numpy-stl
  WARNING: The scripts stl, stl2ascii and stl2bin are installed in '.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  NOTE: The current PATH contains path(s) starting with `~`, which may not be expanded by all applications.
Successfully installed numpy-stl-2.11.2 python-utils-2.4.0
# python
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import stl
>>> stl.__about__.__version__
'2.11.2'
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

arneyjfs commented 3 years ago

I'm getting exactly the same warning. I have the latest version of Numpy. I've done some searching around and no one has raised this issue with numpy directly.

Numpy==1.19.4 Numpy-stl==2.12.0 OS = MacOS BigSur (also happened on Catalina) Python 3.8.5

happens on import of stl.

Steps to recreate (I use pyenv to manage multiple python versions):

pyenv global 3.8.5
python -m pip install numpy-stl
python
>>> import stl

output:

<frozen importlib._bootstrap>:219: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.

If i do the same as above for python 3.7.7, I do not get the error

Is there any other info i can provide to help debug? Thanks

wolph commented 3 years ago

I've been able to reproduce is now. I've narrowed it down to the speedups code which is probably why I couldn't reproduce it earlier... I wasn't recompiling the speedups at that time.

I'm not sure what is causing it exactly however.

wolph commented 3 years ago

Most likely fixed in the latest release. Let me know if you still have issues :)