Installing OSMnx with Anaconda

做~自己de王妃 提交于 2020-03-25 03:36:06

问题


I am trying to install the osmnx package in Python 3 on my computer, following the steps outlined here https://geoffboeing.com/2017/02/python-getting-started/. The steps are:

  1. Download miniconda, with the path C:\Anaconda. I am unable to do this as I am using university computers. However, Anaconda is already installed on those computers, with the path C:\Program Files \Anaconda3.
  2. Within the Anaconda Prompt, I tried conda update -n base conda. However, this does not go through because I do not 'have write permission to the target environment' (C:\Program Files \Anaconda3).
  3. I ignored this error, assuming conda was up to date. conda config --prepend channels conda-forge ran fine.
  4. conda create -n ox -c conda-forge osmnx jupyterlab and conda activate ox ran fine. OSMnx and jupyterlab are listed in Anaconda Navigator>Environments>ox>installed.
  5. In the ox environment, I ran jupyter lab, but this gave the following error. I'm sorry for this huge quote, but I don't know how to interpret any of this:
(ox) C:\Users\bm17652>jupyter lab
[I 15:47:48.265 LabApp] Writing notebook server cookie secret to C:\Users\bm17652\AppData\Roaming\jupyter\runtime\notebook_cookie_secret
Traceback (most recent call last):
  File "C:\Users\bm17652\.conda\envs\ox\Scripts\jupyter-lab-script.py", line 9, in <module>
    sys.exit(main())
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\jupyter_core\application.py", line 268, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\traitlets\config\application.py", line 663, in launch_instance
    app.initialize(argv)
  File "<C:\Users\bm17652\.conda\envs\ox\lib\site-packages\decorator.py:decorator-gen-7>", line 2, in initialize
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\notebook\notebookapp.py", line 1679, in initialize
    self.init_webapp()
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\jupyterlab\labapp.py", line 404, in init_webapp
    super().init_webapp(*args, **kwargs)
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\notebook\notebookapp.py", line 1442, in init_webapp
    self.http_server.listen(port, self.ip)
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\tornado\tcpserver.py", line 152, in listen
    self.add_sockets(sockets)
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\tornado\tcpserver.py", line 165, in add_sockets
    self._handlers[sock.fileno()] = add_accept_handler(
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\tornado\netutil.py", line 279, in add_accept_handler
    io_loop.add_handler(sock, accept_handler, IOLoop.READ)
  File "C:\Users\bm17652\.conda\envs\ox\lib\site-packages\tornado\platform\asyncio.py", line 99, in add_handler
    self.asyncio_loop.add_reader(fd, self._handle_events, fd, IOLoop.READ)
  File "C:\Users\bm17652\.conda\envs\ox\lib\asyncio\events.py", line 501, in add_reader
    raise NotImplementedError
NotImplementedError

When I try to open Jupyter Lab from Anaconda Navigator and run import osmnx as ox, I get the error "No module named 'osmnx'".

To me, it seems like Jupyter Lab is not installed properly, or does not have the proper connections with osmnx. Are these errors occurring because:

  • I haven't updated conda?
  • I am running the code from a different directory (C:\Users\bm17652) than where Anaconda is (C:\Program Files \Anaconda3)?
  • Should I download Anaconda to another path?

来源:https://stackoverflow.com/questions/59802791/installing-osmnx-with-anaconda

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!