मैं पायथन 3.1 पर संख्यात्मक कैसे स्थापित कर सकता हूं?


12

मेरे पास EC2 पर Ubuntu 10.10 सर्वर है। मैंने पायथन 3.1 स्थापित किया, और अब मैं उस पर NumPy स्थापित करना चाहता हूं। मैं यह कैसे करुं? मैंने कोशिश की easy_install-3.1 numpyलेकिन मुझे यह त्रुटि मिली:

RefactoringTool: Refactored /tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/core/defchararray.py
RefactoringTool: Files that were modified:
RefactoringTool: /tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/compat/py3k.py
RefactoringTool: /tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/core/defchararray.py
Running from numpy source directory.Traceback (most recent call last):
  File "/usr/local/bin/easy_install-3.1", line 9, in <module>
    load_entry_point('distribute==0.6.14', 'console_scripts', 'easy_install-3.1')()
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 1855, in main
    with_ei_usage(lambda:
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 1836, in with_ei_usage
    return f()
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 1859, in <lambda>
    distclass=DistributionWithoutHelpCommands, **kw
  File "/usr/lib/python3.1/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/lib/python3.1/distutils/dist.py", line 919, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.1/distutils/dist.py", line 938, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 342, in run
    self.easy_install(spec, not self.no_deps)
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 582, in easy_install
    return self.install_item(spec, dist.location, tmpdir, deps)
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 612, in install_item
    dists = self.install_eggs(spec, download, tmpdir)
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 802, in install_eggs
    return self.build_and_install(setup_script, setup_base)
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 1079, in build_and_install
    self.run_setup(setup_script, setup_base, args)
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/command/easy_install.py", line 1068, in run_setup
    run_setup(setup_script, args)
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/sandbox.py", line 30, in run_setup
    lambda: exec(compile(open(
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/sandbox.py", line 71, in run
    return func()
  File "/usr/local/lib/python3.1/dist-packages/distribute-0.6.14-py3.1.egg/setuptools/sandbox.py", line 33, in <lambda>
    {'__file__':setup_script, '__name__':'__main__'})
  File "setup.py", line 211, in <module>
  File "setup.py", line 204, in setup_package
  File "/tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/distutils/core.py", line 152, in setup
  File "setup.py", line 151, in configuration
  File "/tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/distutils/misc_util.py", line 972, in add_subpackage
  File "/tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/distutils/misc_util.py", line 941, in get_subpackage
  File "/tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/distutils/misc_util.py", line 878, in _get_configuration_from_setup_py
  File "numpy/setup.py", line 5, in configuration
  File "/tmp/easy_install-MiUli2/numpy-1.5.1/build/py3k/numpy/distutils/misc_util.py", line 713, in __init__
ValueError: 'build/py3k/numpy' is not a directory

जवाबों:


4

सुन्न की इस शाखा के कोड में एक फिक्स शामिल है।
यहाँ एक स्निपेट और संबंधित टिप्पणियां हैं:

643         # XXX Hack to get numpy installable with easy_install.
644         # The problem is easy_install runs it's own setup(), which
645         # sets up distutils.core._setup_distribution. However,
646         # when our setup() runs, that gets overwritten and lost.
647         # We can't use isinstance, as the DistributionWithoutHelpCommands
648         # class is local to a function in setuptools.command.easy_install
649         if dist is not None and \
650                 repr(dist).find('DistributionWithoutHelpCommands') != -1:
651             return None
652         return dist

हालाँकि, यदि आप ऐसा नहीं करना चाहते हैं, तो उस python3.1 setup.py installनिर्देशिका के अंदर प्रयास करें जहाँ आपने सुन्न निकाला है। कोड टिप्पणियों में वर्णित easy_install समस्या से बचा जाता है।


2
मैंने अभी 1.6.1 की आधिकारिक रिलीज़ को डाउनलोड किया है, यह सेटअप थ्रीडी के माध्यम से अजगर 3.2 के लिए इंस्टॉल करता है, कोई समस्या नहीं है। sourceforge.net/projects/numpy/files/NumPy/1.6.1
hwjp

-4

इस आदेश को सुन्न स्थापित करने का प्रयास करें

sudo apt-get install python-numpy

2
वह पायथन 3 के लिए इसे स्थापित नहीं करेगा?
hwjp

हमारी साइट का प्रयोग करके, आप स्वीकार करते हैं कि आपने हमारी Cookie Policy और निजता नीति को पढ़ और समझा लिया है।
Licensed under cc by-sa 3.0 with attribution required.