Let's talk about the environment:
Mac Desktops
Python:mac comes with Python 2.7.10
1. First upgrade PIP installation tool: sudo python-m pip install--upgrade--force pip
2. Install Setuptools tool: sudo pip install setuptools==33.1.1
3. Install python-dateutil:sudo pip Install python-dateutil==2.2
4. Installing Six:sudo pip install--ignore-installed Six
5. Installing Jupyter:sudo Install Jupyter
Start command: Enter Jupyter notebook directly in the terminal
Toss for a long time, just do well, the above commands are encountered in the installation of a variety of problems when used, the following write a record of the problems encountered and corresponding solutions
1.importerror:cannot Import Name _thread report this error solution:
sudo pip uninstall python-dateutilsudo pip install python-dateutil==2.2
2.File "/library/python/2.7/site-packages/dateutil/tz/_common.py", line 2, <module>
From six.moves import _thread
Importerror:cannot Import Name _thread
Workaround: Install the six command above
Solve the above problem when the start of the error will still be a bug this is a stubborn mistake:
File "/library/python/2.7/site-packages/packaging/requirements.py", line-in <module>
marker_expr = Originaltextfor (marker_expr ()) ("MARKER")
TypeError: __call__ () takes exactly 2 arguments (1 given)
Workaround: Locate the file in the path directly based on the error message, and open the file to modify the function in line 59
: #MARKER_EXPR = Originaltextfor (marker_expr ()) ("MARKER")
60:marker_expr = Originaltextfor (marker_expr ("MARKER"))
Once modified, save the file directly and run the Jupyter Notebook command again to start the jupyter.
On the question of six, there is a need to delete the six under our default path, or even if the update succeeds, it will not use the latest six
Method: First look at the default six path
Import Six
Print Six. __file__
Then delete:sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six.*
Finally, install update six using the command above
Well, it's not very good to write, just record it.
The process of installing Jupyter notebook on Mac