QuantEcon / lecture-python

Source files for https://python.quantecon.org
BSD 3-Clause "New" or "Revised" License
61 stars 21 forks source link

Cake Eating - Numerical; interpolation issue #244

Closed aorestrup closed 3 years ago

aorestrup commented 3 years ago

I am trying to run the notes on Cake Eating II - Numerical Methods (https://python.quantecon.org/cake_eating_numerical.html) and I am having issues with "!pip install interpolation". I'm getting the following message below. Anything that I am doing wrong? Thanks in advance.

Collecting interpolation Using cached https://files.pythonhosted.org/packages/37/de/2e541d51046d637758b43cbb373250bc0b0dd62f2d383e94664e12820243/interpolation-2.1.6-py3-none-any.whl Collecting scipy>=1.4.1 (from interpolation) Using cached https://files.pythonhosted.org/packages/66/80/d8a5050df5b4d8229e018f3222fe603ce7f92c026b78f4e05d69c3a6c43b/scipy-1.5.2-cp37-cp37m-win_amd64.whl Collecting numba>=0.47 (from interpolation) Using cached https://files.pythonhosted.org/packages/6a/8a/6f544bb1408ef57f4111b8931eff11bf13cb9edb48f152c158a06cf5164b/numba-0.51.2-cp37-cp37m-win_amd64.whl Requirement already satisfied: numpy>=1.18.1 in c:\users\aores\anaconda3\lib\site-packages (from interpolation) (1.19.2) Collecting tempita>=0.5.2 (from interpolation) Requirement already satisfied: setuptools in c:\users\aores\anaconda3\lib\site-packages (from numba>=0.47->interpolation) (41.0.1) Collecting llvmlite<0.35,>=0.34.0.dev0 (from numba>=0.47->interpolation) Using cached https://files.pythonhosted.org/packages/c5/a3/c4963b9b8bafba8cb7c266a6436e514b3a08bd300e31621ccbec7f1a8708/llvmlite-0.34.0-cp37-cp37m-win_amd64.whl Installing collected packages: scipy, llvmlite, numba, tempita, interpolation Found existing installation: scipy 1.2.1 Uninstalling scipy-1.2.1: Successfully uninstalled scipy-1.2.1

ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'c:\users\aores\anaconda3\lib\site-packages\~cipy\interpolate\dfitpack.cp37-win_amd64.pyd' Consider using the --user option or check the permissions.

jstac commented 3 years ago

It looks like a permissions error -- maybe you are not the root user on your machine?

Did you try the error message suggestion: !pip install --user interpolation ?

There's also a conda install option for the package that might be worth trying: https://github.com/EconForge/interpolation.py

aorestrup commented 3 years ago

Thanks. It was a permission error.

Can I ask another question that I am struggling with. When I try to run the code on Spyder, I am getting the following error (when trying to generate the fig on p.6)

File "", line 45, in objective = lambda x: -g(x, *args)

TypeError: bad operand type for unary -: 'NoneType'

This does not happen when I run this code in Jupyter. I can’t figure out what to do.

Any help is very much appreciated.

Thanks


Marcelo Arbex, Ph.D. Professor Department of Economics University of Windsor

From: John Stachurski notifications@github.com Sent: September 21, 2020 3:39 PM To: QuantEcon/lecture-python lecture-python@noreply.github.com Cc: Marcelo Arbex arbex@uwindsor.ca; Author author@noreply.github.com Subject: Re: [QuantEcon/lecture-python] Cake Eating - Numerical; interpolation issue (#244)

It looks like a permissions error -- maybe you are not the root user on your machine?

Did you try the error message suggestion: !pip install --user interpolation ?

There's also a conda install option for the package that might be worth trying: https://github.com/EconForge/interpolation.py

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/QuantEcon/lecture-python/issues/244#issuecomment-696329093, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AHQH4BFO7IRUGZNX4HKPJJ3SG6TWBANCNFSM4RU3T3XQ.

jstac commented 3 years ago

Stick with Jupyter :-)

Or edit a *.py file with https://code.visualstudio.com/ or similar, using the Python extension.

I don't use Spyder but the above two options are more stable.