Acoular logical interpretation of importing third-party sound source libraries in Python and download of acoular

Source: Internet
Author: User

"declaration" Welcome reprint, but please keep the original source of the article →_→

Looking: http://www.cnblogs.com/Qinstudy/

Article Source: http://www.cnblogs.com/Qinstudy/p/8987520.html

Body

Looking hard to master bo, hello! Now there is a project about sound source localization, need to use Python's third-party library: Acoustic Library (also do acoustic package, English name acoular), I go to install Python's third-party package Acoular, according to the official website installation method is always not! Looking hard to master, can answer my doubts?

Acoular Acoustic Library Learner---Xiao Wang

Looking's hard answer:

Xiao Wang classmate, I contact Acoular Acoustic library for some time, I was to download the installation of Acoular package, a while to install, a while to uninstall, a little energy to conquer it.

Since it is the download and installation of a package or software, the different operating systems, installation procedures, methods will vary. So, Xiao Wang, I first say the situation of their own computer: WIN10 system; Python language version: Python3.6.4

I downloaded and installed acoular in the following way:

First install Anaconda, then use the Anaconda prompt command line to download the Acoular package, and finally import the downloaded Acoular package into Python.

don't worry, Xiao Wang. To download the Acoular library, before you know how to download the Acoular library, let me introduce another three software: Anaconda, Python, Pycharm. If you understand the logical relationship between Acoular and the three of them, you will feel that your problem is actually easy to solve. Then I'll take the installation step by step to help you smooth. If you understand the following two parts, I am sure you can find the reason for your installation failure.

Only when you know the reason for your failure, the next time you install the sound source Library acoular, it will come to a ripe!

Xiao Wang, you may ask, you directly tell me to install the specific steps of the acoular is OK, where so much nonsense? Haha, why should I talk about Anaconda, Acoular and Python, pycharm the logical relationship, because I often have this experience: Learn a thing, install a software, if you do not further to understand, understand these steps, just know mechanically to download, install , and not to explore the reasons behind it. Not a few days, I will forget, and then, the next time I installed, I have to start again!

Therefore, looking practice often reminds himself: the concept of learning not only to learn the concept itself, more important is to understand, understand the origin of knowledge!

Below I will discuss from two parts, the first part is the second part of the cushion, that is, the foundation, understand the first part, the second part of the installation of Acoular, the third part acoular import Python is a piece of cake!

I. Basic concepts of Anaconda, acoular and Python, Pycharm four, and four logical relationships

Two. Acoular installation Steps (pro-test effective)

Three. Acoular import in Python

I. Logical relationship of Anaconda, acoular and Python, pycharm

1. The relationship of a collection to an element (Anaconda, Acoular)

1.1 Anaconda (an integrated development environment)

Anaconda is an integrated development environment that comes with a large number of commonly used data science packages including Conda, Python, NumPy, and more than 150 scientific packages in anaconda. Anaconda was developed on the Conda, and the download file for Anaconda was relatively large (approximately MB), as it came with the most commonly used data science package in Python. If your project requires only a few packages, and you also want to save computer space, then install the mini-version of the integrated development environment, called Miniconda, which contains only the Conda package and Python package, the rest of the package, if you need any package, use the command line to download it!

The Conda package is a Package Manager and Environment Manager . In the sound source location, you will use many third-party open source packages, such as NumPy package, scipy package, and so on, and Conda (Package Manager) can help you to install and manage these packages on the computer, you can use Conda package to install , uninstall and Update packages that you need or don't need.

1.2 Acoular (a package (also called a library) used to locate a source

Acoular is a package, this package is built by the Acoular development team, you can use the Acoular package to locate the relevant algorithm of the source. For example, $ conda install–c acoular acoular , after executing this statement, Conda will help you install the Acoular package on your computer, and the ACOUALR package is a packet used to locate the source of the message.

Summarize:

Acoular is a package, this package is built by the Acoular development team, you can use the Acoular package to locate the relevant algorithm of the source. While Anaconda is an integrated development environment that contains the Acoular package, theacoular package is just one of more than 150 packages in Anaconda . If you enter $ conda install-c acoular acoular in the Anaconda prompt command line , Acoular package will be included in the installation after the Anaconda package has been successfully installed.

The logical relationship between 1.3 Anaconda and Acoular

Xiao Wang, you see, 1.1, 1.2 said the basic concept of anaconda, Acoular, the following is the logical relationship between the two: in general, if you have installed a acoular package on your computer, but also installed Anaconda integrated development environment, There will be such a package in Anaconda, the name is Acoular. Just like in math. The relationship of a set to an element, Anaconda equivalent to a set, Acoular becomes an element in the collection when you add an element of Acoular (a silent source-positioned package) to the Anaconda collection.

2. The Python language relies on tools---pycharm

2.1 Python (one programming language)

Xiao Wang classmate, since you say you are acoular Sound Source library Learners, so I think you understand a little programming aspect, below I use analogy method to introduce you to Python language. Python is a programming language, it is the same as the Java, C + + language, are high-level languages, programming language installation is necessary to set environment variables, that is, add path path. So you have to learn how to add paths. Python language installation, there is a dialog box: Add environment Variables for python, tick, you do not have to manually add environment variables!

If you forget to make a tick when you install it, you need to manually add the environment variable yourself. For example, your Python installation directory name is: D:\Python3.6.4, you only need to add ";D: \python3.6.4" at the end of Path path (this is the Windows7 system), if the WINDOWS10 system, What you need to do is simply to create a new file in the path and add "D:\Python3.6.4". It is important to remind you that in Win10, adding the path path does not have a semicolon, which is a big difference between the WIN10 and Win7 system settings path path.

Xiao Wang, if you do not configure path path, first of all patiently check the path path configuration is wrong, careful to check several times. If you still can't find the reason, you can ask the friends around you. Of course, the more convenient way is to uninstall Python, reinstall, then you have to remember: there is a dialog box, add environment variables for python, tick, you do not need to manually add environment variables.

2.2 Pycharm (an integrated development environment)

Xiao Wang, after downloading and installing the path path, if you want to write Python code well, you need to install a very useful integrated development environment--pycharm. With Pycharm, you don't have to hit the command line to write and run the code. You only need to write code in the Pycharm integrated development environment and then click the Run button, and Pycharm will compile and run the code for you. All in all, use an integrated development environment instead of compiling and running code on the command line, so you can save a lot of time and learn what you're interested in by saving time!

So, what is Pycharm? Pycharm is an integrated development environment, Pycharm is a python IDE (called the Python Integrated development environment) created by JetBrains Company, Pycharm has the functions of general integrated development environment, such as debugging, syntax highlighting, Project management, code jumps, smart tips, and more.

3. The logical relationship of Anaconda, Acoular,Python, Pycharm four

looking the logical analysis of hard practice: Xiao Wang Classmate, you see the Anaconda, Acoular, Python, pycharm Four basic concepts, I ask you a question, the question is as follows:

What should I do if I am now aiming to use the Acoular package in the Anaconda integrated development environment in the Pycharm integrated development environment ? The following is a logical analysis:

Because I'm going to use the Acoular this package, if you use the D:\Python3.6.4\ in Project interpreter(item compiler) Python.exe path, it is not possible to import the Acoular package because the Acoular package is located in the Anaconda integrated development environment, so when Project interpreter (Project interpreter) The path is: D:\Python3.6.4\ Python.exe, Pycharm will error, error is as follows: "Acoular" can not be found.

The correct approach is to change the path of Project Interpreter (Project compiler) to:D:anaconda\python.exe , so that when modified, the compiler will follow d:anaconda\ Python.exe this path to find the Anaconda in the Acoular package, and finally found the Acoular package. So in the Pycharm integrated development environment, compiled through, that is, Acoular import success!

two. Acoular Download step (pro-Test active)

Xiao Wang, if you want to download and use the Acoular Acoustics library, you first need to download the following libraries:

Numpy,scipy,traits,scikit-learn (aka Sklearn), Pytables (aka Tables), Numba,pyqt,traitsui,libpython (only for Windows), Configparser (only for Python 2.7),
Six (only for Python 3)

You might ask: why do I need to download the libraries above? In fact, when you use the Acoular Acoustics Library yourself, the answer is quite simple. Because many of the algorithms in the Acoular Acoustics library (such as plot functions for drawing plots, array arrays) rely on these libraries. So, Xiao Wang, if you manually delete a library, the program will be error, the reason for the error is: You can not find the library you deleted.

Xiao Wang, if you go to download the above these libraries, is very cumbersome, wasting time, so I recommend you use another easy way: The first step to install Anaconda, and then use Anaconda prompt command line to download Acoular package, Finally, the downloaded Acoular package is imported into Python.

In general, downloading and using acoular can be divided into the following steps:

1. Download and install Anaconda (Note: The configuration of path paths in Anaconda);

2. Use the Anaconda prompt command line to download the Acoular package;

3. Import the Acoular acoustics package into the Pycharm integrated development environment.

The following Qin study hard to follow the steps step by step down execution:

1. Download and install Anaconda(configuration of Path in Anaconda)

Xiao Wang classmate, Anaconda's download and installation online has many tutorials, from the letter you wrote, I believe you have the strength to download and install Anaconda. But I need to remind you: Anaconda installation process needs to configure the path, if the path is not configured, then you Anaconda prompt command line input:Conda , will error, error content as follows: ' Conda ' is not an internal, external command, or a program or batch file that can be run. Why did the compiler error, the reason is that Xiao Wang you did not configure the path of paths. The solution is as follows:

Anaconda installation, there is a dialog box: Add environment Variables for anaconda, tick, you do not have to manually add environment variables!

If you forget to make a tick when you install it, you need to manually add the environment variable yourself. For example, Xiao Wang classmate, your Anaconda's installation directory name is: D:\Anaconda.

In the WINDOWS10 system, you only need to create a new file in the path path, and then add "D:\Anaconda\Scripts". It is important to remind you that in Win10, adding the path path does not have a semicolon, which is a big difference between the WIN10 and Win7 system settings path path.

Xiao Wang, if you configure the path, again in the Anaconda prompt command line input:Conda , if you can run, then the environment configuration This, you successfully passed! If, still error: ' Conda ' is not an internal, external command, or a running program or batch file. First of all, you have to be patient to check if the path configuration error, carefully to check several times. If you still can't find the reason, you can ask the friends around you. Of course, the easier way is to uninstall Anaconda ( Uninstall Anaconda method: Double-click the uninstall icon, wait for the program to run OK ), and then reinstall, then you have to remember: there is a dialog box, add environment variables for Anaconda, With a tick, you don't have to manually add the environment variable yourself.

2. Use the Anaconda prompt command line to download the Acoular package

Xiao Wang classmate, now that you see the second part, the contents of the first part, considerations (Configuring environment variables for anaconda) You must have understood it. The following Qin study hard with pictures and text staggered way, explaining the acoular download process.

First step: Enter the following code on the Anaconda prompt command line :

Conda install-c acoular Acoular

Xiao Wang, you may have to ask what this means? In fact, you seriously read, understand the code of English words, can roughly guess the role of this statement. I think you have guessed it, the above line of statement function is: with Conda(a Package Manager and Environment Manager, with the Conda package to install, uninstall and update
or unwanted packages) to download and install the Acoular Acoustics Library.

Xiao Wang, after you enter this line of code to run, the Anaconda prompt command line interface is as follows:

Step Two: The Anaconda prompt command line appears: Proceed ([y]/n)?

This statement means that the compiler is asking: Do you want to overwrite the old version? If you overwrite the old version, enter:y ; If you do not overwrite the old version, enter: N. Here you choose to overwrite the old version, so keyboard input: Y.

Xiao Wang, if you choose to overwrite the old version, the Anaconda prompt command line will download the corresponding file, packet, Anaconda prompt command line interface as follows:

Step Three: Enter an example provided by the Acoular library to verify that the Acoular is installed successfully

Xiao Wang classmate, you patiently wait for the second step to complete, enter the following code in the Anaconda prompt command line:

Acoular_demo

The above line of code is to display an example in the Acoular library, wait a few seconds, the computer will appear two pictures, one is containing 3 sources of sound source map, the other is a picture of 64 microphones. The Anaconda prompt command line interface is as follows:

Xiao Wang, when you finish the above three small steps, Acoular download, installation succeeded. Next, looking practice will tell you, how to import acoular into Python?

Three. Acoular import in Python

Xiao Wang, if you want to use the Acoular Acoustics library in Python, you need to modify the path to the project interpreter in the Pycharm integrated development environment. Because when the path in Project interpreter (item interpreter) is: D:\Python3.6.4\python.exe, Pycharm will error, the error is as follows: "Acoular" could not be found.

Remember A. 3, Anaconda, Acoular, Python, pycharm in the logic of the relationship, looking the logical analysis of hard practice?

How do I use the acoular package in the Anaconda integrated development Environment in the Pycharm integrated development environment? The following is a logical analysis:

Because Xiao Wang you need to use acoular this package, if you use the D:\Python3.6.4\ in Project interpreter(item compiler) Python.exe path, it is not possible to import the Acoular package because the Acoular package is located in the Anaconda integrated development environment, so when Project interpreter (Project interpreter) The path is: D:\Python3.6.4\ Python.exe, Pycharm will error, error is as follows: "Acoular" can not be found.

The correct approach is to change the path of Project Interpreter (Project compiler) to:D:anaconda\python.exe , so that when modified, the compiler will follow d:anaconda\ Python.exe this path to find the Anaconda in the Acoular package, and finally found the Acoular package. So in the Pycharm integrated development environment, compiled through, that is, Acoular import success!

Double-tap Open pycharm, click File/setting/project:/project Interpreter, and then modify the path of Project interpreter to:D:anaconda\python.exe. specific operations such as:

Xiao Wang, after you walk through these steps, the download and installation of the Acoular Acoustics library and the import are successful! You can use the Acoular library to achieve sound source localization algorithm, well to complete your project, I wish you good luck!

Four. Methodology

Xiao Wang, very happy, you can ask "How to import the third-party acoustic library in Python acoular" problem, this interesting question prompted me to think about Anaconda, Acoular, Python, pycharm four logical relationship . To tell you about the Acoular library download, installation and import knowledge, I think looking hard to "import acoustic library in Python acoular" logical interpretation and deepened! This let bloggers again understand: learning concept not only to learn the concept itself, more importantly, understand, understand the origin of knowledge!

Acoular logical interpretation of importing third-party sound source libraries in Python and download of acoular

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.