AllenDowney / ThinkDSP

Think DSP: Digital Signal Processing in Python, by Allen B. Downey.
https://allendowney.github.io/ThinkDSP/
3.93k stars 3.2k forks source link

Installation instructions #20

Closed TonderaiZR closed 5 years ago

TonderaiZR commented 8 years ago

Hello

How do I install the thinkdsp module on computer. So I can call the functions.

Cheers

AllenDowney commented 8 years ago

It's not really meant to be installed. I suggest cloning the repo from GitHub and working in that directory. There are instructions in the preface.

Please let me know if that helps.

Allen

On Sat, Apr 2, 2016 at 8:59 PM, Tondy notifications@github.com wrote:

Hello

How do I install the thinkdsp module on computer. So I can call the functions.

Cheers

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/AllenDowney/ThinkDSP/issues/20

TonderaiZR commented 8 years ago

Hello Allen Thank you very much. I now have it working with python notebook.

TomOHaver commented 7 years ago

I am new to Python/GitHub/Jupyter/Binder/whatever. I don't even understand "cloning the repo from GitHub and working in that directory". I've tried the instructions in the preface of your ThinkDSP book. Excellent work, by the way. I've tried three different versions of Python in Windows and the version that comes with a Raspberry Pi. All I get are cryptic error messages, such as "ModuleNotFoundError: No module named 'thinkdsp'". Any suggestions on what I can try next?

Tom O'Haver, toh@umd.edu https://terpconnect.umd.edu/~toh/spectrum/SignalProcessingTools.html

henzosabiq commented 6 years ago

Here is my manual 'hacks' to make it work.

  1. Clone the repository using git bash git clone https://github.com/AllenDowney/ThinkDSP.git
  2. Copy all python files (.py) on the code folder image image
  3. Locate where you install Python. On Windows, you can try where python command in cmd and it will show the path. For example, it gives me : C:\Users\henzo\AppData\Local\Programs\Python\Python36\python.exe. Copy C:\Users\<PC names>\AppData\Local\Programs\Python\<python version>\ to windows explorer and press enter. Go to Lib\site-packages and you will see names of all Python packages you've installed. image
  4. Make a new folder. I name it "AllenDowney" because I respect his amazing work.
  5. Paste all the python files from code folder here
  6. Open all of the python files. Add AllenDowney. in front of any import that starts with think, and add as think as closing. If you find import thinkdsp, you should rename it to import AllenDowney.thinkdsp as thinkdsp.

When you want to 'install' this module to another computer, just copy the AllenDowney folder and move it to C:\Users\<PC names>\AppData\Local\Programs\Python\<python version>\Lib\site-packages

TomOHaver commented 6 years ago

Thanks for that very specific recommendation. I'll try it.

VicerExciser commented 6 years ago

@henzosabiq Good advice, thank you. However that method did not work 100% for me, but I have some supplementary steps that will get it to work:

  1. Follow above steps 1:5.
  2. Rather than modifying the new package's module imports as suggested in step 6, locate the file site.py in the site-packages directory.
  3. Add the following line after the import statements for site.py: sys.path.append( 'C:\<path to Python install>\Lib\site-packages\<name of new package>\' )

site.py is imported automatically whenever the Python CLI is executed, so now you should be able to (in this case) successfully use the pure import thinkdsp statement in your code.

patukes commented 5 years ago

Please I have problem run the import thinkdsp.It still produces error.No module found

talhaanwarch commented 5 years ago

Please I have problem run the import thinkdsp.It still produces error.No module found please run pip install thinkx in anaconda prompt, it will install think dsp

dan54956 commented 5 years ago

pip install thinkx

this works! thanks

janarthan-j commented 4 years ago

Try to install the "thinkx" as it mentions in this link https://anaconda.org/conda-forge/thinkx
It's worked for me! This solution for the Anaconda and pycharm users.

To install this package with conda run one of the following: conda install -c conda-forge thinkx conda install -c conda-forge/label/cf201901 thinkx

psjpang commented 4 years ago

Try to install the "thinkx" as it mentions in this link https://anaconda.org/conda-forge/thinkx It's worked for me! This solution for the Anaconda and pycharm users.

To install this package with conda run one of the following: conda install -c conda-forge thinkx conda install -c conda-forge/label/cf201901 thinkx

hi~ I tried to run like this in pycharm, but it still fails. If you can, can you take a screenshot of where you added these two lines of code?