View Code? Open in Web Editor
NEW
Source code for my Medium article on the modern portfolio theory
License: MIT License
mpt_medium_notebook's People
Contributors
Watchers
mpt_medium_notebook's Issues
how do i Solve this error
Collecting functools
Using cached functools-0.5.tar.gz (4.9 kB)
Building wheels for collected packages: functools
Building wheel for functools (setup.py) ... ?25lerror
ERROR: Command errored out with exit status 1:
command: /Users/hakon-wilhelm/opt/miniconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/setup.py'"'"'; file='"'"'/private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-wheel-lokdz2gk
cwd: /private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/
Complete output (26 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
copying functools.py -> build/lib.macosx-10.9-x86_64-3.8
running build_ext
building '_functools' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/hakon-wilhelm/opt/miniconda3/include -arch x86_64 -I/Users/hakon-wilhelm/opt/miniconda3/include -arch x86_64 -I/Users/hakon-wilhelm/opt/miniconda3/include/python3.8 -c src/functools.c -o build/temp.macosx-10.9-x86_64-3.8/src/functools.o
src/functools.c:43:6: warning: implicit declaration of function 'Py_InitModule3' is invalid in C99 [-Wimplicit-function-declaration]
m = Py_InitModule3("_functools", NULL, functools_doc);
^
src/functools.c:43:6: warning: this function declaration is not a prototype [-Wstrict-prototypes]
src/functools.c:43:4: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
m = Py_InitModule3("_functools", NULL, functools_doc);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/functools.c:45:3: error: non-void function 'init_functools' should return a value [-Wreturn-type]
return;
^
src/functools.c:49:2: error: non-void function 'init_functools' should return a value [-Wreturn-type]
return;
^
3 warnings and 2 errors generated.
error: command 'gcc' failed with exit status 1
ERROR: Failed building wheel for functools
?25h Running setup.py clean for functools
Failed to build functools
Installing collected packages: functools
Running setup.py install for functools ... ?25lerror
ERROR: Command errored out with exit status 1:
command: /Users/hakon-wilhelm/opt/miniconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/setup.py'"'"'; file='"'"'/private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-record-0bprin5j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/hakon-wilhelm/opt/miniconda3/include/python3.8/functools
cwd: /private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/
Complete output (26 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
copying functools.py -> build/lib.macosx-10.9-x86_64-3.8
running build_ext
building '_functools' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/hakon-wilhelm/opt/miniconda3/include -arch x86_64 -I/Users/hakon-wilhelm/opt/miniconda3/include -arch x86_64 -I/Users/hakon-wilhelm/opt/miniconda3/include/python3.8 -c src/functools.c -o build/temp.macosx-10.9-x86_64-3.8/src/functools.o
src/functools.c:43:6: warning: implicit declaration of function 'Py_InitModule3' is invalid in C99 [-Wimplicit-function-declaration]
m = Py_InitModule3("_functools", NULL, functools_doc);
^
src/functools.c:43:6: warning: this function declaration is not a prototype [-Wstrict-prototypes]
src/functools.c:43:4: warning: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion]
m = Py_InitModule3("_functools", NULL, functools_doc);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/functools.c:45:3: error: non-void function 'init_functools' should return a value [-Wreturn-type]
return;
^
src/functools.c:49:2: error: non-void function 'init_functools' should return a value [-Wreturn-type]
return;
^
3 warnings and 2 errors generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
?25hERROR: Command errored out with exit status 1: /Users/hakon-wilhelm/opt/miniconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/setup.py'"'"'; file='"'"'/private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-install-2rlqyyjt/functools_e2b25273428448358d2a8f1f2543c600/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/var/folders/84/w8ftyyhn1qvcc4pdvkf27r4m0000gn/T/pip-record-0bprin5j/install-record.txt --single-version-externally-managed --compile --install-headers /Users/hakon-wilhelm/opt/miniconda3/include/python3.8/functools Check the logs for full command output.
ImportError Traceback (most recent call last)
in
8 get_ipython().system('pip install functools')
9
---> 10 from functools import cache # Python 3.9 required
11
12 import yfinance as yf
ImportError: cannot import name 'cache' from 'functools' (/Users/hakon-wilhelm/opt/miniconda3/lib/python3.8/functools.py)