I have been trying to install the VSCode IDE package, but on opening a new window in VSCode I get the following message:
Installing PlatformIO Core…
Please don’t close this window and don’t open other folders until this process is completed.
Failed to install PlatformIO IDE.
Right before a Window pops up with the following message:
Virtualenv Create: Traceback (most recent call last):
File “/Users/Oscar/.platformio/.cache/tmp-2399SLQU7JE3cU7U/virtualenv-14.0.6/virtualenv.py”, line 29, in
import tempfile
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py”, line 34, in
from random import Random as _Random
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/random.py”, line 49, in
import hashlib as _hashlib
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py”, line 139, in
globals()[__func_name] = __get_hash(__func_name)
File “/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py”, line 72, in __get_builtin_constructor
import _md5
File “build/bdist.macosx-10.12-intel/egg/_md5.py”, line 7, in
File “build/bdist.macosx-10.12-intel/egg/_md5.py”, line 4, in bootstrap
File “/Library/Python/2.7/site-packages/pkg_resources/init.py”, line 1205, in resource_filename
self, resource_name
File “/Library/Python/2.7/site-packages/pkg_resources/init.py”, line 1717, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name))
File “/Library/Python/2.7/site-packages/pkg_resources/init.py”, line 1753, in _extract_resource
outf, tmpnam = _mkstemp(“.$extract”, dir=os.path.dirname(real_path))
File “/Library/Python/2.7/site-packages/pkg_resources/init.py”, line 2962, in _mkstemp
return tempfile.mkstemp(*args, **kw)
AttributeError: ‘module’ object has no attribute ‘mkstemp’
I have managed to get it installed by logging in as a “guest user” on my computer, then install the VSCode IDE, copy the .platformio folder to my home folder and it works. But I don’t know if this way is going to give me problems later on.
As I suspect there is something wrong with my Python installation and I don’t know much about Python.
I had done that already, but this did not do the trick. However, I seemed to have an incomplete MacPorts installation that messed up my Python. Commenting out the path to MacPorts did the trick.