Python 3.4 pyximport error - windows

I have two files named as experiment.py and low_dim_cython.pyx. I am using python 3.4 in PyCharm. In experiment.py, I tried to import low_dim_cython.pyx as:
import numpy
import pyximport
pyximport.install(pyximport.install(setup_args={'include_dirs':[numpy.get_include()]}))
import low_dim_cython
It throws these errors given below.
Traceback (most recent call last):
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\site-packages\pyximport\pyximport.py", line 216, in load_module
inplace=build_inplace, language_level=language_level)
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\site-packages\pyximport\pyximport.py", line 192, in build_module
reload_support=pyxargs.reload_support)
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\site-packages\pyximport\pyxbuild.py", line 102, in pyx_to_dll
dist.run_commands()
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\site-packages\Cython\Distutils\old_build_ext.py", line 185, in run
_build_ext.build_ext.run(self)
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\distutils\command\build_ext.py", line 339, in run
self.build_extensions()
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\site-packages\Cython\Distutils\old_build_ext.py", line 193, in build_extensions
self.build_extension(ext)
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\distutils\command\build_ext.py", line 503, in build_extension
depends=ext.depends)
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\distutils\msvc9compiler.py", line 460, in compile
self.initialize()
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\distutils\msvc9compiler.py", line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\AppData\Local\Continuum\Anaconda3\envs\priview3.4\lib\distutils\msvc9compiler.py", line 259, in query_vcvarsall
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat

Related

PyPy Error: AttributeError: No symbol SCDynamicStoreCopyProxies found in library <None>

I have a program on my Mac, and I think it is too slow. I want to use pypy to speed it up.
I got pypy's binary distribution for mac, and I ran ./pypy -m pip install .... It said that I need to run ensurepip. But when I ran it, it raised this error:
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/runpy.py", line 196, in _run_module_as_main
"__main__", mod_spec)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/ensurepip/__init__.py", line 214, in _main
default_pip=args.default_pip,
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/ensurepip/__init__.py", line 127, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/ensurepip/__init__.py", line 32, in _run_pip
runpy.run_module("pip", run_name="__main__", alter_sys=True)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/runpy.py", line 208, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/__main__.py", line 26, in <module>
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_internal/cli/main.py", line 73, in main
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 104, in create_command
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1015, in _gcd_import
File "<frozen importlib._bootstrap>", line 992, in _find_and_load
File "<frozen importlib._bootstrap>", line 976, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap>", line 647, in _load_backward_compatible
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_internal/commands/install.py", line 24, in <module>
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_internal/cli/req_command.py", line 16, in <module>
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_internal/index/package_finder.py", line 21, in <module>
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_internal/index/collector.py", line 14, in <module>
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/__init__.py", line 28, in <module>
File "/var/folders/v8/6phlhg3j00b85wfb6_sh7syh0000gn/T/tmpjikdylze/pip-20.1.1-py2.py3-none-any.whl/pip/_vendor/html5lib/serializer.py", line 11, in <module>
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/xml/sax/saxutils.py", line 6, in <module>
import os, urllib.parse, urllib.request
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/urllib/request.py", line 2618, in <module>
from _scproxy import _get_proxy_settings, _get_proxies
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib_pypy/_scproxy.py", line 64, in <module>
ffi = _CFSetup()
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib_pypy/_scproxy.py", line 63, in _CFSetup
return CFProxy()
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib_pypy/_scproxy.py", line 52, in __init__
func = getattr(mod, fname)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/ctypes/__init__.py", line 382, in __getattr__
func = self.__getitem__(name)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib-python/3/ctypes/__init__.py", line 387, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib_pypy/_ctypes/function.py", line 255, in __init__
ptr = self._getfuncptr([], ctypes.c_int)
File "/Users/Andy/Downloads/pypy3.7-v7.3.3-osx64/lib_pypy/_ctypes/function.py", line 442, in _getfuncptr
self._ptr = cdll.getfunc(self.name, ffi_argtypes, ffi_restype)
AttributeError: No symbol SCDynamicStoreCopyProxies found in library <None>
What's wrong with it? Please help me! Thanks
This is issue 3314 and has been fixed in the nightly builds. We are waiting for confirmation that the issue is fixed, so please comment on the issue.

Spyder latest version

Did any one face this issue while downloading the latest Anaconda3 and opened spyder?
An error ocurred while starting the kernel
The error is:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole\plugin.py", line 1173, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle, **kwargs)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\manager.py", line 301, in start_kernel
kernel_cmd, kw = self.pre_start_kernel(**kw)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\manager.py", line 248, in pre_start_kernel
self.write_connection_file()
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\connect.py", line 474, in write_connection_file
kernel_name=self.kernel_name
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_client\connect.py", line 138, in write_connection_file
with secure_write(fname) as f:
File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_core\paths.py", line 435, in secure_write
win32_restrict_file_to_user(fname)
File "C:\Users\user\AppData\Roaming\Python\Python37\site‑packages\jupyter_core\paths.py", line 361, in win32_restrict_file_to_user
import win32api
ImportError: DLL load failed: %1 is not a valid Win32 application.
Any help will be appreciated !!

Getting Error when importing format_suffix_patterns from Django Rest Framework

I am learning Django Rest Framework.
I used format_suffix_patterns to support suffixes in the Urls
Everything was fine, till suddenly I started getting error
_frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('django.test.signals') at 1367726740816
and
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Even on importing 'format_suffix_patterns' with
from rest_framework.urlpatterns import format_suffix_patterns
gives the error.
But just before I started using viewsets there was no problem.
I tried removing the old env and creating a new env
Deleting the pycache and retrying
This is the include that is creating the error
from rest_framework.urlpatterns import format_suffix_patterns
The full error
Exception in thread django-main-thread:
Traceback (most recent call last):
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\utils.py", line 66, in __getitem__
return self._engines[alias]
KeyError: 'django'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\threading.py", line 916, in _bootstrap_inner
self.run()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\threading.py", line 864, in run
self._target(*self._args, **self._kwargs)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 54, in wrapper
fn(*args, **kwargs)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\commands\runserver.py", line 117, in inner_run
self.check(display_num_errors=True)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\base.py", line 390, in check
include_deployment_checks=include_deployment_checks,
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\base.py", line 377, in _run_checks
return checks.run_checks(**kwargs)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\checks\registry.py", line 72, in run_checks
new_errors = check(app_configs=app_configs)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\contrib\admin\checks.py", line 79, in check_dependencies
for engine in engines.all():
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\utils.py", line 90, in all
return [self[alias] for alias in self]
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\utils.py", line 90, in <listcomp>
return [self[alias] for alias in self]
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\utils.py", line 81, in __getitem__
engine = engine_cls(params)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\backends\django.py", line 25, in __init__
options['libraries'] = self.get_templatetag_libraries(libraries)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\backends\django.py", line 43, in get_templatetag_libraries
libraries = get_installed_libraries()
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\backends\django.py", line 108, in get_installed_libraries
for name in get_package_libraries(pkg):
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\template\backends\django.py", line 121, in get_package_libraries
module = import_module(entry[1])
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "E:\Web Development\messmanager\app\env\lib\site-packages\rest_framework\templatetags\rest_framework.py", line 15, in <module>
from rest_framework.renderers import HTMLFormRenderer
File "E:\Web Development\messmanager\app\env\lib\site-packages\rest_framework\renderers.py", line 20, in <module>
from django.test.client import encode_multipart
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\test\client.py", line 23, in <module>
from django.test import signals
File "<frozen importlib._bootstrap>", line 968, in _find_and_load
File "<frozen importlib._bootstrap>", line 149, in __enter__
File "<frozen importlib._bootstrap>", line 94, in acquire
_frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('django.test.signals') at 1367726740816
Traceback (most recent call last):
File "E:/Web Development/messmanager/app_old/manage.py", line 21, in <module>
main()
File "E:/Web Development/messmanager/app_old/manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\__init__.py", line 381, in execute_from_command_line
utility.execute()
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\base.py", line 323, in run_from_argv
self.execute(*args, **cmd_options)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute
super().execute(*args, **options)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\base.py", line 364, in execute
output = self.handle(*args, **options)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\commands\runserver.py", line 95, in handle
self.run(**options)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\core\management\commands\runserver.py", line 102, in run
autoreload.run_with_reloader(self.inner_run, **options)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 585, in run_with_reloader
start_django(reloader, main_func, *args, **kwargs)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 570, in start_django
reloader.run(django_main_thread)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 288, in run
self.run_loop()
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 294, in run_loop
next(ticker)
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 334, in tick
for filepath, mtime in self.snapshot_files():
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 350, in snapshot_files
for file in self.watched_files():
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 249, in watched_files
yield from iter_all_python_module_files()
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 103, in iter_all_python_module_files
return iter_modules_and_files(modules, frozenset(_error_files))
File "E:\Web Development\messmanager\app\env\lib\site-packages\django\utils\autoreload.py", line 136, in iter_modules_and_files
if not path.exists():
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\pathlib.py", line 1334, in exists
self.stat()
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\pathlib.py", line 1156, in stat
return self._accessor.stat(self)
File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\pathlib.py", line 387, in wrapped
return strfunc(str(pathobj), *args)
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: '<frozen importlib._bootstrap>'
Even I was facing same error.
I commented below code and it worked for me.
from rest_framework.urlpatterns import format_suffix_patterns
urlpatterns = format_suffix_patterns(urlpatterns)

Python Multiprocessing Error with IBM API (Q Experience)

I'm trying to use the IBM Q Experience API and I installed the library and wrote a quick test code. At first, it couldn't find the module. Then, I added the whole sys thing. Admittedly, I just copied that from a stackoverflow post so that may be the problem. Anyways, I got "RunTime Error" which leads to the python multiprocessing lib. The IBM Q doesn't have a big community, so I couldn't find anything after researching a little while. I'm completely unfamiliar with multiprocessing, threading, etc, so I imagine just seeing the code and error will be better than anything I can do to explain. Thanks in advance.
import sys
sys.path.append("../../")
from qiskit import QuantumProgram
#visualization
from tools.visualization import plot_histogram
#set up registers
qp = QuantumProgram()
q = qp.create_quantum_register("q", 3)
c = qp.create_classical_register("c", 3)
#define our circuit
threeQ = qp.create_circuit("threeQ", [q], [c])
threeQ.measure(q[0], c[0])
threeQ.measure(q[1], c[1])
threeQ.measure(q[2], c[2])
#run
result = qp.execute(["threeQ"])
#plot
plot_histogram(result.get_counts("threeQ"))
The error I get (sorry, it's long):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 106, in spawn_main
exitcode = _main(fd)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 115, in _main
prepare(preparation_data)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 226, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 278, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 254, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Everybody\firstquantum.py", line 21, in <module>
print(qp.execute(["threeQ"]))
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_quantumprogram.py", line 1413, in execute
result = self.run(qobj, wait=wait, timeout=timeout)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_quantumprogram.py", line 1232, in run
timeout=timeout)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_quantumprogram.py", line 1315, in _run_internal
job_processor.submit()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_jobprocessor.py", line 118, in submit
future = executor.submit(run_backend, q_job)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\concurrent\futures\process.py", line 454, in submit
self._start_queue_management_thread()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\concurrent\futures\process.py", line 415, in _start_queue_management_thread
self._adjust_process_count()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\concurrent\futures\process.py", line 434, in _adjust_process_count
p.start()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 212, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 313, in _Popen
return Popen(process_obj)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\popen_spawn_win32.py", line 34, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 144, in get_preparation_data
_check_not_importing_main()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 137, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 106, in spawn_main
exitcode = _main(fd)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 115, in _main
prepare(preparation_data)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 226, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 278, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 254, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Everybody\firstquantum.py", line 21, in <module>
print(qp.execute(["threeQ"]))
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_quantumprogram.py", line 1413, in execute
result = self.run(qobj, wait=wait, timeout=timeout)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_quantumprogram.py", line 1232, in run
timeout=timeout)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_quantumprogram.py", line 1315, in _run_internal
job_processor.submit()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\site-packages\qiskit\_jobprocessor.py", line 118, in submit
future = executor.submit(run_backend, q_job)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\concurrent\futures\process.py", line 454, in submit
self._start_queue_management_thread()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\concurrent\futures\process.py", line 415, in _start_queue_management_thread
self._adjust_process_count()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\concurrent\futures\process.py", line 434, in _adjust_process_count
p.start()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 212, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 313, in _Popen
return Popen(process_obj)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\popen_spawn_win32.py", line 34, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 144, in get_preparation_data
_check_not_importing_main()
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 137, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 106, in spawn_main
exitcode = _main(fd)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 115, in _main
prepare(preparation_data)
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 226, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 278, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Users\Everybody\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 254, in run_path
ERROR
This is a general issue with multi-threading in Python on Windows. The solution is to put your top-level code in an if __name__ == "__main__" block, as in:
if __name__ == '__main__':
<your code here>
Hope that helps!

Error while starting Plone instance

I'm trying to run Plone on my mac. but I couldn't its showing the following message. Any idea about how to fix this?
learner-Mac:zinstance learner$ ./bin/instance fg
2015-02-14 17:14:37 INFO ZServer HTTP server started at Sat Feb 14 17:14:37 2015
Hostname: 0.0.0.0
Port: 8080
2015-02-14 17:14:39 INFO DocFinderTab Applied patch version 1.0.5.
2015-02-14 17:14:39 WARNING ZODB.blob (12250) Blob dir /Users/learner/Plone/zinstance/var/blobstorage/ has insecure mode setting
2015-02-14 17:14:39 INFO plone.jsonapi.router DefaultRouter::__init__
2015-02-14 17:14:39 INFO plone.jsonapi.router DefaultRouter.add_url_rule: /version (apiversion) -> 'apiversion' options: {'methods': ['GET']}
Traceback (most recent call last):
File "/Users/learner/Plone/zinstance/parts/instance/bin/interpreter", line 296, in <module>
exec(compile(__file__f.read(), __file__, "exec"))
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
run()
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 22, in run
starter.prepare()
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/__init__.py", line 86, in prepare
self.startZope()
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/__init__.py", line 262, in startZope
Zope2.startup()
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/__init__.py", line 47, in startup
_startup()
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/App/startup.py", line 118, in startup
load_zcml()
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/App/startup.py", line 52, in load_zcml
load_site()
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/App/zcml.py", line 46, in load_site
_context = xmlconfig.file(site_zcml)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 649, in file
include(context, name, package)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
processxmlfile(f, context)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
parser.parse(src)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
self.context.end()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
self.stack.pop().finish()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
actions = self.handler(context, **args)
File "/Users/learner/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/OFS/metaconfigure.py", line 46, in loadProducts
xmlconfig.include(_context, zcml, package=product)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
processxmlfile(f, context)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
parser.parse(src)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
self.context.end()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
self.stack.pop().finish()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
actions = self.handler(context, **args)
File "/Users/learner/Plone/buildout-cache/eggs/z3c.autoinclude-0.3.5-py2.7.egg/z3c/autoinclude/zcml.py", line 104, in includePluginsDirective
includeZCMLGroup(_context, info, filename)
File "/Users/learner/Plone/buildout-cache/eggs/z3c.autoinclude-0.3.5-py2.7.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
include(_context, filename, includable_package)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
processxmlfile(f, context)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
parser.parse(src)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
self.context.end()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
self.stack.pop().finish()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
actions = self.handler(context, **args)
File "/Users/learner/Plone/buildout-cache/eggs/z3c.autoinclude-0.3.5-py2.7.egg/z3c/autoinclude/zcml.py", line 54, in includeDependenciesDirective
includeZCMLGroup(_context, info, 'configure.zcml')
File "/Users/learner/Plone/buildout-cache/eggs/z3c.autoinclude-0.3.5-py2.7.egg/z3c/autoinclude/zcml.py", line 30, in includeZCMLGroup
include(_context, filename, includable_package)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
processxmlfile(f, context)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
parser.parse(src)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
self.feed(buffer)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
self._parser.Parse(data, isFinal)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
self._cont_handler.endElementNS(pair, None)
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
self.context.end()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
self.stack.pop().finish()
File "/Users/learner/Plone/buildout-cache/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
actions = self.handler(context, **args)
File "/Users/learner/Plone/buildout-cache/eggs/z3c.autoinclude-0.3.5-py2.7.egg/z3c/autoinclude/zcml.py", line 51, in includeDependenciesDirective
info = DependencyFinder(dist).includableInfo(['configure.zcml', 'meta.zcml'])
File "/Users/learner/Plone/buildout-cache/eggs/z3c.autoinclude-0.3.5-py2.7.egg/z3c/autoinclude/dependency.py", line 26, in includableInfo
module = resolve(dotted_name)
File "/Users/learner/Plone/buildout-cache/eggs/zope.dottedname-3.4.6-py2.7.egg/zope/dottedname/resolve.py", line 32, in resolve
found = __import__(used)
File "/Users/learner/Plone/buildout-cache/eggs/WeasyPrint-0.19.2-py2.7.egg/weasyprint/__init__.py", line 304, in <module>
from .css import PARSER, preprocess_stylesheet
File "/Users/learner/Plone/buildout-cache/eggs/WeasyPrint-0.19.2-py2.7.egg/weasyprint/css/__init__.py", line 30, in <module>
from . import computed_values
File "/Users/learner/Plone/buildout-cache/eggs/WeasyPrint-0.19.2-py2.7.egg/weasyprint/css/computed_values.py", line 18, in <module>
from .. import text
File "/Users/learner/Plone/buildout-cache/eggs/WeasyPrint-0.19.2-py2.7.egg/weasyprint/text.py", line 18, in <module>
import cairocffi as cairo
File "/Users/learner/Plone/buildout-cache/eggs/cairocffi-0.6-py2.7.egg/cairocffi/__init__.py", line 41, in <module>
cairo = dlopen(ffi, *CAIRO_NAMES)
File "/Users/learner/Plone/buildout-cache/eggs/cairocffi-0.6-py2.7.egg/cairocffi/__init__.py", line 34, in dlopen
return ffi.dlopen(names[0]) # pragma: no cover
File "/Users/learner/Plone/buildout-cache/eggs/cffi-0.8.6-py2.7-macosx-10.10-intel.egg/cffi/api.py", line 118, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "/Users/learner/Plone/buildout-cache/eggs/cffi-0.8.6-py2.7-macosx-10.10-intel.egg/cffi/api.py", line 411, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "/Users/learner/Plone/buildout-cache/eggs/cffi-0.8.6-py2.7-macosx-10.10-intel.egg/cffi/api.py", line 400, in _load_backend_lib
return backend.load_library(name, flags)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/learner/Plone/zinstance/parts/instance/etc/site.zcml", line 16.2-16.23
ZopeXMLConfigurationError: File "/Users/learner/Plone/buildout-cache/eggs/Products.CMFPlone-4.3.4.1-py2.7.egg/Products/CMFPlone/configure.zcml", line 98.4-102.10
ZopeXMLConfigurationError: File "/Users/learner/Plone/zinstance/src/bika.health/bika/health/configure.zcml", line 11.2-11.37
ZopeXMLConfigurationError: File "/Users/learner/Plone/buildout-cache/eggs/bika.lims-3.1.5-py2.7.egg/bika/lims/configure.zcml", line 13.0-13.35
OSError: cannot load library libcairo.so.2: dlopen(libcairo.so.2, 2): image not found
You are using WeasyPrint, and that project requires Cairo to be installed.
You'll need to install that missing dependency. You can probably get it via Homebrew, I see there is a formula available at any rate.

Resources