I creat a new environment by anaconda,but when I want to launch spyder,I meet the below problem. Who can help me?
(sae) C:\Users\limin>spyder
Traceback (most recent call last):
File "C:\Users\limin\Anaconda3\envs\sae\Scripts\spyder-script.py", line 3, in <module>
import spyder.app.start
File "C:\Users\limin\Anaconda3\Lib\site-packages\spyder\app\start.py", line 23, in <module>
from spyder.utils.external import lockfile
File "C:\Users\limin\Anaconda3\Lib\site-packages\spyder\utils\external\lockfile.py", line 22, in <module>
import psutil
File "C:\Users\limin\Anaconda3\Lib\site-packages\psutil\__init__.py", line 126, in <module>
from . import _pswindows as _psplatform
File "C:\Users\limin\Anaconda3\Lib\site-packages\psutil\_pswindows.py", line 16, in <module>
from . import _psutil_windows as cext
ImportError: cannot import name _psutil_windows
Related
When I run a python script in Pycharm it works perfectly. When I try to run it via the command line it errors:
C:\Users\Administrator\anaconda3\python.exe "C:\Users\Administrator\Desktop\Scripts\KD.py"
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\Scripts\Kariba_Dwell.py", line 10, in <module>
import s3fs
File "C:\Users\Administrator\anaconda3\lib\site-packages\s3fs\__init__.py", line 1, in <module>
from .core import S3FileSystem, S3File
File "C:\Users\Administrator\anaconda3\lib\site-packages\s3fs\core.py", line 15, in <module>
import botocore.session
File "C:\Users\Administrator\anaconda3\lib\site-packages\botocore\session.py", line 30, in <module>
import botocore.credentials
File "C:\Users\Administrator\anaconda3\lib\site-packages\botocore\credentials.py", line 42, in <module>
from botocore.utils import InstanceMetadataFetcher, parse_key_val_file
File "C:\Users\Administrator\anaconda3\lib\site-packages\botocore\utils.py", line 31, in <module>
import botocore.httpsession
File "C:\Users\Administrator\anaconda3\lib\site-packages\botocore\httpsession.py", line 7, in <module>
from urllib3.util.ssl_ import (
ImportError: cannot import name 'ssl' from 'urllib3.util.ssl_' (C:\Users\Administrator\anaconda3\lib\site-packages\urllib3\util\ssl_.py)
You need to activate your environment in the command-line.
For instance: Assume your environment name is conda_torch
conda activate conda_torch then an activated environment will be available.
Then you should type: python KD.py
I can not run my Python script or even run command Python to go to python shell. What's wrong with my Python?
machine:project user$ python
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 62, in <module>
import os
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 398, in <module>
import UserDict
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 83, in <module>
import _abcoll
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py", line 11, in <module>
from abc import ABCMeta, abstractmethod
File "abc.py", line 2, in <module>
import scipy.special
File "/Library/Python/2.7/site-packages/scipy/__init__.py", line 70, in <module>
from numpy import show_config as show_numpy_config
File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/Library/Python/2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Python/2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Python/2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Python/2.7/site-packages/numpy/core/__init__.py", line 11, in <module>
from . import numeric
File "/Library/Python/2.7/site-packages/numpy/core/numeric.py", line 5, in <module>
import collections
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 6, in <module>
__all__ += _abcoll.__all__
AttributeError: 'module' object has no attribute '__all__'
But anyway everything still looks fine if run Python outside my project directory.
You have a local file called abc.py which is hiding the built-in abc module. Rename your file to something else.
I can not run my Python script or even run command Python to go to python shell. What's wrong with my Python?
machine:project user$ python
Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 62, in <module>
import os
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 398, in <module>
import UserDict
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserDict.py", line 83, in <module>
import _abcoll
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/_abcoll.py", line 11, in <module>
from abc import ABCMeta, abstractmethod
File "abc.py", line 2, in <module>
import scipy.special
File "/Library/Python/2.7/site-packages/scipy/__init__.py", line 70, in <module>
from numpy import show_config as show_numpy_config
File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 153, in <module>
from . import add_newdocs
File "/Library/Python/2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Python/2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Python/2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Python/2.7/site-packages/numpy/core/__init__.py", line 11, in <module>
from . import numeric
File "/Library/Python/2.7/site-packages/numpy/core/numeric.py", line 5, in <module>
import collections
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py", line 6, in <module>
__all__ += _abcoll.__all__
AttributeError: 'module' object has no attribute '__all__'
But anyway everything still looks fine if run Python outside my project directory.
You have a local file called abc.py which is hiding the built-in abc module. Rename your file to something else.
I have Ubuntu 12.04 with Python 2.7 and Python 3 installed. I installed pygame through sudo apt-get python-pygame and also from the source. When I tried >>>import pygame on Python I get this error:
`
>>> import pygame<br>
Jello, world!<br>
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pygame/__init__.py", line 255, in <module>
try: import pygame.surfarray
File "/usr/lib/python2.7/dist-packages/pygame/surfarray.py", line 69, in <module>
import pygame._numpysurfarray as numpysf
File "/usr/lib/python2.7/dist-packages/pygame/_numpysurfarray.py", line 48, in <module>
import numpy
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
import polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/__init__.py", line 18, in <module>
from polynomial import Polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polynomial.py", line 60, in <module>
from polytemplate import polytemplate
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polytemplate.py", line 20, in <module>
polytemplate = string.Template('''
AttributeError: 'module' object has no attribute 'Template'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 18, in <module>
import problem_report
File "/usr/lib/python2.7/dist-packages/problem_report.py", line 16, in <module>
from email.mime.multipart import MIMEMultipart
File "/usr/lib/python2.7/email/mime/multipart.py", line 9, in <module>
from email.mime.base import MIMEBase
File "/usr/lib/python2.7/email/mime/base.py", line 9, in <module>
from email import message
File "/usr/lib/python2.7/email/message.py", line 16, in <module>
import email.charset
File "/usr/lib/python2.7/email/charset.py", line 14, in <module>
import email.quoprimime
File "/usr/lib/python2.7/email/quoprimime.py", line 48, in <module>
from string import hexdigits
ImportError: cannot import name hexdigits
Original exception was:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pygame/__init__.py", line 255, in <module>
try: import pygame.surfarray
File "/usr/lib/python2.7/dist-packages/pygame/surfarray.py", line 69, in <module>
import pygame._numpysurfarray as numpysf
File "/usr/lib/python2.7/dist-packages/pygame/_numpysurfarray.py", line 48, in <module>
import numpy
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
import polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/__init__.py", line 18, in <module>
from polynomial import Polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polynomial.py", line 60, in <module>
from polytemplate import polytemplate
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polytemplate.py", line 20, in <module>
polytemplate = string.Template('''
AttributeError: 'module' object has no attribute 'Template'
I saw the Jello World so I guess it is working a bit. I dont know what to do. I appreciate the help. Thanks in advance.
That looks like you don't have SDL installed on your box.
Remove your current pygame packages then dot he following:
wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz
tar -xzvf SDL-1.2.14.tar.gz
cd SDL-1.2.14
./configure
make
make install
Once this has completed reinstall pygame but try reinstalling via easy_install or pip:
easy_install pygame
or
pip install pygame
You should be good to go after that.
I am trying to use elastic beanstalk cli on an amazon linux instance and I always get zlib module error. This probably is more to do with my linux/unix ignorance but please send any inputs you have.
$ eb init
Traceback (most recent call last):
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/eb", line 17, in <module>
from scli import core
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/core .py", line 24, in <module>
from scli import command, cli_parse, config_file, prompt
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/comm and.py", line 18, in <module>
from scli.operation_queue import OperationQueue
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/oper ation_queue.py", line 19, in <module>
from scli.operation.base import OperationBase
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/oper ation/base.py", line 21, in <module>
from lib.elasticbeanstalk import eb_utils
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/elast icbeanstalk/eb_utils.py", line 22, in <module>
from scli import api_wrapper
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/api_ wrapper.py", line 19, in <module>
from lib.elasticbeanstalk.servicecall import ElasticBeanstalkClient
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/elast icbeanstalk/servicecall.py", line 23, in <module>
from lib.aws.webservice import AWSQueryClient, AWSSignature
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/w ebservice.py", line 26, in <module>
from . import requests
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/r equests/__init__.py", line 52, in <module>
from . import utils
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/r equests/utils.py", line 18, in <module>
import zlib
ImportError: No module named zlib