I get the following error when trying to open a Jupyter Notebook (using the command jupyter notebook) from the terminal on mac.
Traceback (most recent call last):
File "/Applications/anaconda3/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 1531, in initialize
super(NotebookApp, self).initialize(argv)
File "<decorator-gen-6>", line 2, in initialize
File "/anaconda3/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 242, in initialize
self.migrate_config()
File "/anaconda3/lib/python3.6/site-packages/jupyter_core/application.py", line 168, in migrate_config
migrate()
File "/anaconda3/lib/python3.6/site-packages/jupyter_core/migrate.py", line 247, in migrate
with open(os.path.join(env['jupyter_config'], 'migrated'), 'w') as f:
PermissionError: [Errno 13] Permission denied: '/Users/Mridula/.jupyter/migrated'
I have tried to uninstall and re-install. I still face the same error. I have tried to clear the bash profile, to no avail.
Any help would be highly welcome and appreciated.
Best,
Mridula
I'm summarizing our conversations here as it helped you to resolve the problem.
There could be many possible options to address this issue. However, the very first approach to tackle this problem is to resolve permission issues. The last line of your error message is PermissionError: [Errno 13] Permission denied: '/Users/Mridula/.jupyter/migrated' which means you don't have the right permission to access the .jupyter directory.
Change file permission
sudo chmod -R 755 /Users/Mridula/.jupyter/
If this doesn't help then do the following steps
uninstall Anaconda
remove .jupyter directory from your user
install a fresh copy of Anaconda
Hope it helps!
Related
I was trying to create a virtual env with python3. But it failed to create new. But the existing virtual env are working fine.
Traceback (most recent call last):
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\embed\via_app_data\via_app_data.py", line 82, in _get
result = get_wheel(
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\acquire.py", line 23, in get_wheel
wheel = from_bundle(distribution, version, for_py_version, search_dirs, app_data, do_periodic_update, env)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\bundle.py", line 17, in from_bundle
wheel = periodic_update(distribution, of_version, for_py_version, wheel, search_dirs, app_data, per, env)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\periodic_update.py", line 35, in periodic_update
handle_auto_update(distribution, for_py_version, wheel, search_dirs, app_data, env)
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\seed\wheels\periodic_update.py", line 69, in handle_auto_update
embed_update_log.write(u_log.to_dict())
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\site-packages\virtualenv\app_data\via_disk_folder.py", line 154, in write
self.file.write_text(json.dumps(content, sort_keys=True, indent=2))
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1154, in write_text
with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f:
File "C:\Users\DELL\AppData\Local\Programs\Python\Python310\lib\pathlib.py", line 1119, in open
return self._accessor.open(self, mode, buffering, encoding, errors,
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\DELL\\AppData\\Local\\pypa\\virtualenv\\wheel\\3.10\\embed\\3\\pip.json'
fail
Your problem is the permission to write to the folder, which you must give to the Python interpreter
Give admin access to the command line
I'm extremely new to Python, so sorry if this is a stupid question. Anyways, I'm getting this error when trying to run a package I installed on PyCharm (Python IDE):
Traceback (most recent call last):
File "C:\Users\turtl\PycharmProjects\untitled\venv\Scripts\openbte-script.py", line 11, in <module>
load_entry_point('openbte==0.9.24', 'console_scripts', 'openbte')()
File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\__main__.py", line 47, in main
Geometry(**vars(args))
File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\geometry.py", line 83, in __init__
data = self.compute_mesh_data()
File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\geometry.py", line 91, in compute_mesh_data
self.import_mesh()
File "C:\Users\turtl\PycharmProjects\untitled\venv\lib\site-packages\openbte\geometry.py", line 448, in import_mesh
a=subprocess.check_output(['gmsh','-' + str(self.dim),'mesh.geo','-o','mesh.msh'])
File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "C:\Users\turtl\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 997, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
From what I've gathered from previous questions, it seems this is because I don't have gmsh in my virtualenv. Now that I've downloaded gmsh, I can't find a proper installation guide on how to get it into the virtualenv. Does anyone have experience with this?
I guess more specifically, is there a way I can pinpoint the path that it's trying to access and just paste gmsh into that directory?
openbte\geometry.py seems to run gmsh.exe without any path:
a=subprocess.check_output(['gmsh','-' + str(self.dim),'mesh.geo','-o','mesh.msh'])
Which means it expects gmsh.exe somewhere in the %PATH%. So install gmsh and add the directory with gmsh.exe to the %PATH%.
Im still a newbie in anaconda, python and jupyter notebook.
I am doing my assignment which is exploring anaconda and jupyter.
windows 10, 64bit
python 3.6.4
anaconda 4.4.10
Why I cant launch jupyter notebook? First time i tried it was successful. And i continue with importing the libraries. Then, when the next time i open anaconda prompt and tried jupyter notebook , i got this error:
Traceback (most recent call last):
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2760, in get_entry_map
ep_map = self._ep_map
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2731, in getattr
raise AttributeError(attr)
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\LENOVO\Anaconda3\Scripts\jupyter-notebook-script.py", line 10, in
sys.exit(main())
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\jupyter_core\application.py", line 266, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
app.initialize(argv)
File "", line 2, in initialize
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1507, in initialize
self.init_webapp()
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1270, in init_webapp
self.jinja_environment_options
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 156, in init
default_url, settings_overrides, jinja_env_options)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 268, in init_settings
nbextensions_path=jupyter_app.nbextensions_path,
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 973, in nbextensions_path
from IPython.paths import get_ipython_dir
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython__init__.py", line 55, in
from .terminal.embed import embed
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython\terminal\embed.py", line 16, in
from IPython.terminal.interactiveshell import TerminalInteractiveShell
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 91, in
class TerminalInteractiveShell(InteractiveShell):
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 134, in TerminalInteractiveShell
highlighting: \n %s""" % ', '.join(get_all_styles())
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pygments\styles__init__.py", line 79, in get_all_styles
for name, _ in find_plugin_styles():
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pygments\plugin.py", line 62, in find_plugin_styles
for entrypoint in iter_entry_points(STYLE_ENTRY_POINT):
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 737, in iter_entry_points
entries = dist.get_entry_map(group)
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2763, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "C:\Users\LENOVO\Anaconda3\lib\site-packages\pkg_resources__init__.py", line 2496, in parse_map
raise ValueError("Entry points must be listed in groups")
ValueError: Entry points must be listed in groups
Is a big thank you if anyone can help me solve this! :)
Feel free to drop any comment/suggestion. Thank you!!
First of all i recommend to re install anaconda again and to select the check box which says to Set Anaconda path in system so that you can use it from anywhere.
To make sure that we are going in right direction go to the bin/ in the anaconda folder.
once you are in bin you can see that there is a jupyter-notebook.exe thus execute it in the command prompt.
Also you can try using Anaconda Navigator to do the same thing.
You can also try running it as Administrator if there are any permission issues.
There have been changes in jupyter notebooks latest release so you can read the docs for more info
When I started learning Python I didn't know about virtualenv and so installed all my stuff at system level.
I wanted to do a full clean out to prevent issues. However, creating the requirements.txt and then trying to run uninstall on it throws the following error and doesn't complete any uninstalling. Any ideas what might be wrong?
> Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/site-packages/pip/commands/uninstall.py", line 76, in run
requirement_set.uninstall(auto_confirm=options.yes)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 346, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/local/Cellar/python/2.7.12_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/awscli-1.11.83.dist-info/DESCRIPTION.rst'
Not an amazing solution but i rebooted terminal and tried sudo again and it cooperated this time... i cant offer more than that im afrad
I was installing pymc through conda, and it told me to update a few of the files so no problem. However, after updating, it gave an OSError, and now, I cannot access any conda build commands. Now, when I type any conda command, it gives me
-bash: conda: command not found
I checked the bash_profile, and .bashrc, and both have the appropriate PATH for conda, and most modules installed through conda still works. Running python and checking the version yields
Python 2.7.11 :: Anaconda custom (x86_64)
Looking at the ~/anaconda/bin, I see that the conda folder is not there. Is there anyway to fix this? Is the only solution to re-install anaconda?
Sorry, I do not have any of the terminal outputs since I closed all my windows. Also, I didn't realize I was running Jupyter notebook in the background, but this shouldn't have a problem. Jupyter no longer runs, and yields the error
[W 01:34:35.979 NotebookApp] Unrecognized JSON config file version, assuming version 1
Traceback (most recent call last):
File "/Users/kaichang/anaconda/bin/jupyter-notebook", line 6, in <module>
sys.exit(notebook.notebookapp.main())
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/traitlets/config/application.py", line 595, in launch_instance
app.initialize(argv)
File "<decorator-gen-7>", line 2, in initialize
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/traitlets/config/application.py", line 74, in catch_config_error
return method(app, *args, **kwargs)
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/notebook/notebookapp.py", line 1069, in initialize
self.init_configurables()
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/notebook/notebookapp.py", line 837, in init_configurables
parent=self,
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 19, in __init__
specs = self.find_kernel_specs() or {}
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 129, in find_kernel_specs
self.conda_info = self._conda_info()
File "/Users/kaichang/anaconda/lib/python2.7/site-packages/nb_conda_kernels/manager.py", line 29, in _conda_info
p = subprocess.check_output(["conda", "info", "--json"]
File "/Users/kaichang/anaconda/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/Users/kaichang/anaconda/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/Users/kaichang/anaconda/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Sorry, I'm just not entirely sure what is going on.
Looking at the ~/anaconda/bin, I see that the conda folder is not
there. Is there anyway to fix this?
In answer to this, you can try overwriting your conda installation:
bash /path/to/Miniconda2-latest-MacOSX-x86_64.sh -bfp /Users/kaichang/anaconda/